PayPal ExpressCheckout 缺少总计列

发布于 2024-12-04 12:44:46 字数 2408 浏览 0 评论 0原文

为什么我在结帐页面上找不到总数?

缺少总计

抱歉。

由于我的代码正在运行,因为它实际上到达了 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?

Missing Totals

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一腔孤↑勇 2024-12-11 12:44:46

尝试将 &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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文