小编Kor*_*iar的帖子

未捕获的错误:没有值传递给付款

Windows 上的 ASP.Net Framework 4.5.2

\n\n

我正在使用服务器端 REST配置与 paypal 的集成,我的代码与此https://github.com/paypal/PayPal-NET-SDK/blob/develop/Samples/Source/PaymentWithPayPal.aspx.cs相同,没有什么区别。

\n\n

支付模式

\n\n

创建的支付模型是这样的:

\n\n
{"intent":"sale","payer":{"payment_method":"paypal"},"transactions":[{"amount":{"currency":"USD","total":"100.00","details":{"subtotal":"75","shipping":"10","tax":"15"}},"description":"Transaction description.","invoice_number":"608961","item_list":{"items":[{"sku":"sku","name":"Item Name","quantity":"5","price":"15","currency":"USD"}]}}],"redirect_urls":{"return_url":"http://localhost:51379/PaymentWithPayPal.aspx?guid=60896","cancel_url":"http://localhost:51379/PaymentWithPayPal.aspx?guid=60896&cancel=true"}}\n
Run Code Online (Sandbox Code Playgroud)\n\n

创建支付模型后

\n\n

我在这一行创建付款

\n\n
var createdPayment = payment.Create(apiContext);\n
Run Code Online (Sandbox Code Playgroud)\n\n

创建支付

\n\n

并且createdPayment变量等于:

\n\n
{"id":"PAY-8TG15254J2564684XLFQUQHQ","intent":"sale","payer":{"payment_method":"paypal"},"transactions":[{"related_resources":[],"amount":{"currency":"USD","total":"100.00","details":{"subtotal":"75.00","shipping":"10.00","tax":"15.00"}},"description":"Transaction description.","invoice_number":"608961","item_list":{"items":[{"sku":"sku","name":"Item Name","quantity":"5","price":"15.00","currency":"USD"}]}}],"state":"created","create_time":"2017-07-08T21:01:18Z","links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-8TG15254J2564684XLFQUQHQ","rel":"self","method":"GET"},{"href":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-6PE445186E489192C","rel":"approval_url","method":"REDIRECT"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-8TG15254J2564684XLFQUQHQ/execute","rel":"execute","method":"POST"}]}\n
Run Code Online (Sandbox Code Playgroud)\n\n

错误

\n\n

之后,代码继续,没有任何错误,完成后,paypal 窗口关闭,我在 javascript 上收到下一个错误:\n 错误:没有值传递给付款

\n\n
Object {stack: "Error: No value passed to payment\xe2\x86\xb5 at https://w\xe2\x80\xa6://www.paypalobjects.com/api/checkout.js:2390:13)", errtype: "[object Error]", timestamp: 1499547706746, windowID: "5148517b93", pageID: "510d0e1522"\xe2\x80\xa6} country:"US" env:"sandbox" errtype:"[object Error]" host:"www.sandbox.paypal.com" lang:"en" pageID:"510d0e1522" path:"/webapps/hermes/button" referer:"http://localhost:51379" stack:"Error: No value passed …
Run Code Online (Sandbox Code Playgroud)

c# asp.net paypal paypal-sandbox paypal-rest-sdk

5
推荐指数
1
解决办法
3637
查看次数

标签 统计

asp.net ×1

c# ×1

paypal ×1

paypal-rest-sdk ×1

paypal-sandbox ×1