e.g I have 4 products in the cart One time purchase "$20" One time purchase "$15" Subscription product "$10" monthly Subscription product "$17" yearly I want to purchase all these products once through paypal website. User should be redirect to paypal website for payment and then redirect back back to our site for saving purchased data. Please confirm is this feasible or not.
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
'USER' => 'user',
'PWD' => 'password',
'SIGNATURE' => 'key',
'METHOD' => 'SetExpressCheckout',
'VERSION' => '108',
'LOCALECODE' => 'pt_BR',
'PAYMENTREQUEST_0_AMT' => '20',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale',
'PAYMENTREQUEST_0_ITEMAMT' => '20',
'L_PAYMENTREQUEST_0_NAME0' => 'Exemplo',
'L_PAYMENTREQUEST_0_DESC0' => 'Assinatura de exemplo1',
'L_PAYMENTREQUEST_0_AMT0' => '12',
'L_BILLINGTYPE0' => 'RecurringPayments',
'L_BILLINGAGREEMENTDESCRIPTION0' => 'Exemploo',
'L_PAYMENTREQUEST_0_NAME1' => 'Exemplo2',
'L_PAYMENTREQUEST_0_DESC1' => 'Assinatura de exemplo2',
'L_PAYMENTREQUEST_0_AMT1' => '8',
'L_BILLINGTYPE1' => 'RecurringPayments',
'L_BILLINGAGREEMENTDESCRIPTION1' => 'Exemploo',
'CANCELURL' => 'http://localhost/cancel.html',
'RETURNURL' => 'http://localhost/project/practice/paypal_website/createRecurringPaymentsProfile.php'
)));
<!-- create recurring profile -->
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
'USER' => 'user',
'PWD' => 'password',
'SIGNATURE' => 'key',
'METHOD' => 'CreateRecurringPaymentsProfile',
'VERSION' => '108',
'LOCALECODE' => 'pt_BR',
'TOKEN' => $token,
'PayerID' => $PayerID,
'PROFILESTARTDATE' => '2018-12-05T16:00:00Z',
'DESC' => 'Exemploo',
'BILLINGPERIOD' => 'Month',
'BILLINGFREQUENCY' => '1',
'AMT' => 20,
'CURRENCYCODE' => 'USD',
'COUNTRYCODE' => 'US',
'MAXFAILEDPAYMENTS' => 3,
"L_PAYMENTREQUEST_0_ITEMCATEGORY0"=>"Digital",
"L_PAYMENTREQUEST_0_NAME0"=>"Exemplo",
"L_PAYMENTREQUEST_0_AMT0"=>12,
"L_PAYMENTREQUEST_0_QTY0"=>1,
"L_PAYMENTREQUEST_0_ITEMCATEGORY1"=>"Digital",
"L_PAYMENTREQUEST_0_NAME1"=>"Exemplo2",
"L_PAYMENTREQUEST_0_AMT1"=>8,
"L_PAYMENTREQUEST_0_QTY1"=>1,
)));
Comments
Post a Comment