489495df
* // Create a gateway for the PayPal REST Gateway * // (routes to GatewayFactory::create) * $gateway = Omnipay::create('PayPal_Rest'); * * // Initialise the gateway * $gateway->initialize(array( * 'clientId' => 'MyPayPalClientId', * 'secret' => 'MyPayPalSecret', * 'testMode' => true, // Or false when you are ready for live transactions * )); * * // Do a complete subscription transaction on the gateway * $transaction = $gateway->completeSubscription(array( * 'transactionReference' => $subscription_id, * )); * $response = $transaction->send(); * if ($response->isSuccessful()) { * echo "Complete Subscription transaction was successful!\n"; * $subscription_id = $response->getTransactionReference(); * echo "Subscription reference = " . $subscription_id; * } *
* curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-agreements/EC-0JP008296V451950C/agreement-execute \ * -H 'Content-Type:application/json' \ * -H 'Authorization: Bearer ' \ * -d '{}' *
* { * "id": "I-0LN988D3JACS", * "links": [ * { * "href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS", * "rel": "self", * "method": "GET" * } * ] * } *