PayPal REST API through PHP SDK return “Incoming JSON request does not map to API request”

前端 未结 2 1401
暖寄归人
暖寄归人 2021-01-28 10:10

I\'m trying to create and execute a payment with PayPal REST API through PHP SDK (sandbox environment) like showing below. The payment creation ($payment->create

2条回答
  •  灰色年华
    2021-01-28 11:04

    It was enough put

    $payment->setIntent('authorize')
    

    instead of

    $payment->setIntent('sale')
    

    and eliminate the execution

    $execution = new PaymentExecution(); $result = $payment->execute($execution, $apiContext);
    

    Then, after

    $payment->create
    

    I used the "href" from

    $payment->links
    

    to do the redirect. Everything went perfectly. Thank you all.

提交回复
热议问题