PayPal ExpressCheckout 缺少总计列
为什么我在结帐页面上找不到总数?
抱歉。
由于我的代码正在运行,因为它实际上到达了 PayPal 并且所有字段都正确。 我认为没有必要发布代码。 我认为可以简单地回答:“您在发给 PayPal 的帖子中缺少 XXXX 变量。”
但是,由于这是 StackOverflow,因此需要代码。
这就是 COLDFUSION(是的,因为人们认为这是一种已死/垂死的语言)。
<cffunction name="expressCheckout" access="remote" returnformat="JSON" output="false" description="Processes PayPal Subscription">
<cfargument name="L_BILLINGAGREEMENTDESCRIPTION0" type="string" required="yes" />
<cfargument name="L_BILLINGTYPE0" type="string" required="yes" />
<cfargument name="AMT" type="numeric" required="yes" />
<cfset var username = "wpp_1306278086_biz_api1.blahblah.com">
<cfset var password = "1306278555">
<cfset var signature = "someSig">
<cfset var serverURL = "https://api-3t.sandbox.paypal.com/nvp">
<cfset var version = "65.1">
<cfset requestData = StructNew()>
<cfset requestData.USER = "#USERNAME#">
<cfset requestData.PWD = "#PASSWORD#">
<cfset requestData.SIGNATURE = "#SIGNATURE#">
<cfset requestData.SUBJECT = "">
<cfset requestData.VERSION = "#version#">
<cfset requestData.METHOD = "SetExpressCheckout">
<cfset requestData.AMT = "#arguments.AMT#">
<cfset requestData.DESC = "#arguments.L_BILLINGAGREEMENTDESCRIPTION0#">
<cfset requestData.CUSTOM = "#session.rfcid#">
<cfset requestData.returnURL = "http://localhost:8500/rfc2-1/membership/payPalConfirm.cfm">
<cfset requestData.cancelURL = "http://localhost:8500/rfc2-1/membership/creditcardform.cfm">
<cfset payPalReturn = doHttppost(requestData, serverURL, "no")>
<cfset payPalReturn = getNVPResponse(#URLDecode(payPalReturn)#)>
<cfif payPalReturn.ACK EQ "Failure">
<!--- return the error message --->
<cfset payPalReturn.ERRORMESSAGE = #payPalReturn.L_LONGMESSAGE0#>
</cfif>
<cfreturn payPalReturn>
</cffunction>
这会将 json 对象返回给浏览器。 然后浏览器将我发送到: https://sandbox.paypal.com/cgi- bin/webscr?cmd=_express-checkout&token=SomeToken
当我到达 PayPal 时一切都很好。只是缺少左侧框中的总数(如图所示)
Why am I missing the total on the checkout page?
Apologies.
As my code is working, because it actually got to PayPal and does have all the field correct.
I didn't think it was necessary to post the code.
I thought it could be answered simply, "you're missing the XXXX variable in your post to PayPal."
But, seeing as this is StackOverflow, code is required.
This is COLDFUSION (yes caps because people think this is a dead/dying language).
<cffunction name="expressCheckout" access="remote" returnformat="JSON" output="false" description="Processes PayPal Subscription">
<cfargument name="L_BILLINGAGREEMENTDESCRIPTION0" type="string" required="yes" />
<cfargument name="L_BILLINGTYPE0" type="string" required="yes" />
<cfargument name="AMT" type="numeric" required="yes" />
<cfset var username = "wpp_1306278086_biz_api1.blahblah.com">
<cfset var password = "1306278555">
<cfset var signature = "someSig">
<cfset var serverURL = "https://api-3t.sandbox.paypal.com/nvp">
<cfset var version = "65.1">
<cfset requestData = StructNew()>
<cfset requestData.USER = "#USERNAME#">
<cfset requestData.PWD = "#PASSWORD#">
<cfset requestData.SIGNATURE = "#SIGNATURE#">
<cfset requestData.SUBJECT = "">
<cfset requestData.VERSION = "#version#">
<cfset requestData.METHOD = "SetExpressCheckout">
<cfset requestData.AMT = "#arguments.AMT#">
<cfset requestData.DESC = "#arguments.L_BILLINGAGREEMENTDESCRIPTION0#">
<cfset requestData.CUSTOM = "#session.rfcid#">
<cfset requestData.returnURL = "http://localhost:8500/rfc2-1/membership/payPalConfirm.cfm">
<cfset requestData.cancelURL = "http://localhost:8500/rfc2-1/membership/creditcardform.cfm">
<cfset payPalReturn = doHttppost(requestData, serverURL, "no")>
<cfset payPalReturn = getNVPResponse(#URLDecode(payPalReturn)#)>
<cfif payPalReturn.ACK EQ "Failure">
<!--- return the error message --->
<cfset payPalReturn.ERRORMESSAGE = #payPalReturn.L_LONGMESSAGE0#>
</cfif>
<cfreturn payPalReturn>
</cffunction>
This retuns a json object to the browser.
The browser then sends me to:
https://sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=SomeToken
All fine when I get to PayPal. Just missing the total in the left hand box (as diagrammed)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 &useraction=commit 附加到 PayPal 重定向 URL (https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-xxxxxx&useraction=commit)。
不确定这是否适用于计费协议,但值得一试。无论如何,它适用于定期付款。
编辑:
事实上,转念一想;因为它是一个计费协议,不是固定价格的(否则你一开始就不需要计费协议);这是有意的。由于没有具体价格可显示。
Try appending &useraction=commit to the PayPal redirection URL (https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-xxxxxx&useraction=commit).
Not sure of this works for billing agreements, but worth a shot. It'll work for regular payments anyway.
edit:
Actually, on second thought; since it's a billing agreement, which is not for a fixed price (otherwise you wouldn't need a billing agreement in the first place); this would be intended. Since there is no specific price to display.