【问题标题】:How to get state="completed" PayPal Payments如何获得 state="completed" PayPal 付款
【发布时间】:2014-08-19 09:33:24
【问题描述】:

我在执行付款后收到此 JSON,但状态仍为“待处理”我如何解决此问题以获得“已完成”。

为了付款,我尝试了几件事,但都没有成功

{
  "id": "PAY-2NU51454E4492922YKPZRNBA",
  "create_time": "2014-08-19T09:19:00Z",
  "update_time": "2014-08-19T09:19:32Z",
  "intent": "sale",
  "payer": {
    "payment_method": "paypal",
    "payer_info": {
      "email": "severiano.testes@gmail.com",
      "first_name": "Diogo",
      "last_name": "Severiano",
      "payer_id": "MSQ6UB55W52N6",
      "shipping_address": {
        "line1": "1 Main Terrace",
        "line2": "",
        "city": "Wolverhampton",
        "country_code": "GB",
        "postal_code": "W12 4LQ",
        "state": "West Midlands"
      }
    }
  },
  "transactions": [
    {
      "amount": {
        "currency": "EUR",
        "total": "54.00",
        "details": {
          "subtotal": "54.00"
        }
      },
      "description": "Transaction Description",
      "item_list": {
        "items": [
          {
            "quantity": "1",
            "name": "Project Submission (featured)",
            "price": "54.00",
            "currency": "EUR",
            "sku": "27365"
          }
        ],
        "shipping_address": {
          "recipient_name": "Diogo Severiano",
          "line1": "1 Main Terrace",
          "line2": "",
          "city": "Wolverhampton",
          "country_code": "GB",
          "postal_code": "W12 4LQ",
          "state": "West Midlands"
        }
      },
      "related_resources": [
        {
          "sale": {
            "id": "1BJ06026CY7370157",
            "create_time": "2014-08-19T09:19:00Z",
            "update_time": "2014-08-19T09:19:32Z",
            "amount": {
              "currency": "EUR",
              "total": "54.00"
            },
            "state": "pending",
            "parent_payment": "PAY-2NU51454E4492922YKPZRNBA",
            "links": [
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/1BJ06026CY7370157",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/1BJ06026CY7370157/refund",
                "rel": "refund",
                "method": "POST"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-2NU51454E4492922YKPZRNBA",
                "rel": "parent_payment",
                "method": "GET"
              }
            ]
          }
        }
      ]
    }
  ],
  "state": "approved",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-2NU51454E4492922YKPZRNBA",
      "rel": "self",
      "method": "GET"
    }
  ]
} 

我正在使用 C# 来制作: 使用后结果如上。

var data = JsonConvert.DeserializeObject<Rootobject>(context.Session["RespostaJson"].ToString());                
                pymnt = new Payment();
                pymnt.id = data.id;
                PaymentExecution pymntExecution = new PaymentExecution();
                pymntExecution.payer_id = context.Request.Params["PayerID"];
                Payment executedPayment = pymnt.Execute(apiContext, pymntExecution);

                context.Response.Write(JObject.Parse(executedPayment.ConvertToJson()).ToString(Formatting.Indented));

【问题讨论】:

    标签: c# paypal


    【解决方案1】:
    The receiver account (info.severiano-facilitator@gmail.com) has the primary currency set     
    to USD but your transaction currency is in the EUR . Whenever you receive the payment in 
    the currency that your account doesn't hold , you need to manually accept the transaction 
    by logging to the account . Once you accept the payment PayPal will prompt you to either :
    
    1. Deny the payment 
    2. Or accept in the new currency and open the balance in the new currency 
    3. Or accept the payment and convert the payment into your primary currency .
    
    For now I have accepted the EUR currency( second choice 2.) for your sandbox account .   
    Now you should be fine with your next payment and you will receive the Payment status    
    as "completed ".  
    

    【讨论】:

      猜你喜欢
      • 2014-04-03
      • 2016-03-07
      • 2015-07-17
      • 2017-01-24
      • 2016-09-30
      • 2014-06-23
      • 2017-05-06
      • 2018-12-12
      • 2012-10-07
      相关资源
      最近更新 更多