Paypal不会重定向到Approve_url

时间:2015-09-14 13:06:59

标签: api rest paypal

我试图通过curl使用Rest API方法进行PayPal付款申请。首先,我将Rest Api称为获取访问令牌,然后我将Rest Api方法称为paypal pay。

我已经给出了json字符串如下:

{
        "redirect_urls": {
            "cancel_url": "http://localhost/ikcourses.lmscheckout-dev-local.com/CoursePayment/payment",
            "return_url": "http://localhost/ikcourses.lmscheckout-dev-local.com/CoursePayment/payment"
        },
        "intent": "sale",
        "payer": {
            "payment_method": "paypal"
        },
        "transactions": [
            {
                "item_list": {
                    "items": [
                        {
                            "currency": "USD",
                            "price": "10",
                            "tax": "5",
                            "name": "Basics of HTML \\u0026 CSS",
                            "quantity": "1"
                        }
                    ]
                },
                "amount": {
                    "currency": "USD",
                    "total": "15",
                    "details": {
                        "subtotal": "10",
                        "tax": "5"
                    }
                },
                "description": "payment using a PayPal account for Immediate Payment",
                "invoice_number": "1005"
            }
        ]
    }

api已成功执行,并且上述API请求返回以下响应:

{
        "links": [
            {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-1NA56034JE851842GKX3MEOA",
                "method": "GET",
                "rel": "self"
            },
            {
                "href": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd\\u003d_express-checkout\\u0026token\\u003dEC-77E63002BF346662U",
                "method": "REDIRECT",
                "rel": "approval_url"
            },
            {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-1NA56034JE851842GKX3MEOA/execute",
                "method": "POST",
                "rel": "execute"
            }
        ],
        "payer": {
            "payment_method": "paypal"
        },
        "transactions": [
            {
                "invoice_number": "1005",
                "related_resources": [],
                "description": "payment using a PayPal account for Immediate Payment",
                "amount": {
                    "currency": "USD",
                    "total": "15.00",
                    "details": {
                        "subtotal": "10.00",
                        "tax": "5.00"
                    }
                },
                "item_list": {
                    "items": [
                        {
                            "currency": "USD",
                            "price": "10.00",
                            "tax": "5.00",
                            "name": "Basics of HTML \\u0026 CSS",
                            "quantity": 1
                        }
                    ]
                }
            }
        ],
        "state": "created",
        "create_time": "2015-09-14T12:48:56Z",
        "intent": "sale",
        "id": "PAY-1NA56034JE851842GKX3MEOA"
    }

当生成上述响应时,我试图重定向到“链接”下的Response返回的Approval_url,但它没有重定向到approval_url,而Paypal网站正在等待很长时间,最后以下消息由 Paypal Approval url

显示

“内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请与服务器管理员webmaster@paypal.com联系,告知他们错误发生的时间,以及可能导致错误的任何操作。

服务器错误日志中可能提供了有关此错误的更多信息。“

由于此错误,我无法完成执行。任何人都可以告诉,为什么这个错误发生在Paypal Approve网址?

0 个答案:

没有答案