Ich versuche PayPal Express Checkout mit PayPal Payment REST API zu integrieren. Ich möchte, dass unsere Kunden ihren Nutzern die Zahlung per PayPal Express Checkout erlauben.PHP PayPal API Express CheckOut
Ich sehe keine Dokumentation auf ihrer Website erklären, wie Express Checkout mit ihrem Benutzer API Benutzername, Passwort und Unterschrift zu integrieren, stattdessen mit OAUTH Credential Client ID/Token.
Muss ich die adaptive Zahlungsmethode verwenden?
https://devtools-paypal.com/guide/expresscheckout/php?interactive=ON&env=sandbox
https://developer.paypal.com/docs/api/#create-a-payment
$paypal_context = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential('client-id', 'client-token')
);
// $paypal_context->setConfig(
// array(
// 'mode' => 'sandbox',
// 'acct.UserName' => '',
// 'acct.Password' => '',
// 'acct.Signature' => ''
// )
//);
// OR
//$paypal_context = new \PayPal\Rest\ApiContext(
// array(
// 'mode' => 'sandbox',
// 'acct1.UserName' => '',
// 'acct1.Password' => '',
// 'acct1.Signature' => ''
// )
//);
$payer = new \PayPal\Api\Payer();
$amount = new \PayPal\Api\Amount();
$transaction = new \PayPal\Api\Transaction();
$payment = new \PayPal\Api\Payment();
$redirectUrls = new \PayPal\Api\RedirectUrls();
$payer->setPaymentMethod('paypal');
...
$payment->create($paypal_context);
$approvalUrl = $payment->getApprovalLink();