Use PayPal Express
Workflow
Request parameters
Parameter
Type / Description
Request sample
Retrieve PayPal redirect URL
<?php
require ('PATH_TO_AUTH');
$Order = new stdClass();
$Order->Language = 'fr';
//$Order->LocalTime = date('Y-m-d G:i:s');
$Order->CustomerReference = 'APITEST'; //uniqid('TESTCUSTOMER:');
$Product = new stdClass();
$Product->Code = 'my_subscription_1';
$Product->Quantity = 1;
$Order->Items[] = $Product;
$Order->Currency = 'EUR';
$Payment = new stdClass();
$Payment->Type = 'PAYPAL_EXPRESS';
$Payment->Currency = 'EUR';
$Payment->CustomerIP = '91.220.121.21';
$Payment->FundingSource = 'Credit'; // set the funding source (optional), can be Standard (default, existing payment method) and Credit (the payment method will be PayPal credit)
$PayPalExpress = new stdClass();
$PayPalExpress->Email = '[email protected]';
$PayPalExpress->ReturnURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php';
$PayPalExpress->CancelURL = 'http://' . $_SERVER['HTTP_HOST'] . '/api/place_order_api_soap_paypal_express_response.php?cancel=true';
$Payment->PaymentMethod = $PayPalExpress;
$Order->PaymentDetails = $Payment;
// Call the method for retrieving Express Checkout redirect URL
$redirectUrl = $client->getPayPalExpressCheckoutRedirectURL($sessionID, $Order);
header('Location:' . $redirectUrl);Place order with PayPal Express
Response parameters
Parameter
Type
Last updated
Was this helpful?