0
私は以下のコードに示すようにPayPalサンドボックストランザクションを作成しました。それはうまく動作します。しかし、今私はpaypalサイトでの船積みのアドレスダイアログを無効にしたい。私は、この発見 :PHPでPayPalの配送オプションを無効にする方法
$inputfields = new \PayPal\Api\InputFields();
$inputfields->getNoShipping(1);
を私はそれが動作しませ得ます。何がまだ失われていますか?
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET));
$amount = new Amount();
$amount->setCurrency('EUR');
$amount->setTotal($price);
$amount->setDetails($details);
$transaction = new Transaction();
$transaction->setAmount($amount)
->setDescription(...)
->setNotifyUrl( ...);
$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl(...);
->setCancelUrl(...);
$payer = new Payer();
$payer->setPaymentMethod("paypal");
$payment = new Payment();
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction));
try {
$payment->create($apiContext);
} catch (\PayPal\Exception\PayPalConnectionException $e) { }