Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subscription Profiles not supported by Recurring Payment APIs while updating plan price

I am using paypal api for recurring billing. i want to update plan price using paypal api. for this i am using

$curl = curl_init();

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
    'USER' => 'ddsds_da_api',
    'PWD' => '123412432134',
    'SIGNATURE' => 'sgdsdshds',

    'METHOD' => 'UpdateRecurringPaymentsProfile',
    'VERSION' => '108',
    'PROFILEID' => 'I-FYYMDB55ADSH',

    'NOTE' => 'Uma nota opcional, explicando o motivo da mudança',
    'AMT' => 120,
    'CURRENCYCODE' => 'BRL'
)));

$response =    curl_exec($curl);

curl_close($curl);

$nvp = array();

if (preg_match_all('/(?<name>[^\=]+)\=(?<value>[^&]+)&?/', $response, $matches)) {
    foreach ($matches['name'] as $offset => $name) {
        $nvp[$name] = urldecode($matches['value'][$offset]);
    }
}

print_r($nvp);

But i am getting this error Subscription Profiles not supported by Recurring Payment APIs Here is my error

<pre>Array
(
    [PROFILEID] => I-FYYMDB55ADSH
    [TIMESTAMP] => 2015-03-16T15:48:07Z
    [CORRELATIONID] => 33216e1739dde
    [ACK] => Failure
    [VERSION] => 76.0
    [BUILD] => 15735246
    [L_ERRORCODE0] => 11592
    [L_SHORTMESSAGE0] => Subscription Profiles not supported.
    [L_LONGMESSAGE0] => Subscription Profiles not supported by Recurring Payment APIs.
    [L_SEVERITYCODE0] => Error
)

Please let me know what i did wrong.

like image 611
krishna Avatar asked Mar 16 '15 15:03

krishna


2 Answers

As answered in the PayPal Community Help Forum

by PayPal_Frank Administrator answerd: 04-02-2012 11:08 AM

...
The basic subscription button profile IDs are not support by the GetRecurringPaymentsProfileDetails API. This API would only work for subscriptions or recurring payment profiles created via the CreateRecurringPaymentsProfile API through Express Checkout which is our API based checkout solution. Website Payments Pro is not required to use Express Checkout. I know this can be frustrating and we recommend that merchants collect basic subscription information via IPN to store in their own database or view the information on their PayPal account. This has also been submitted as a feature request by our Merchant Technical Services team.
https://www.x.com/developers/paypal/forums/general-support/there-any-api-or-methods-which-i-can-get-...

...

like image 85
Ashish Chaturvedi Avatar answered Nov 02 '22 05:11

Ashish Chaturvedi


You only can check the Status of such an Agreement when you use a url like:

$url = 'https://api.paypal.com/v1/payments/billing-agreements/'.$z_res[0]['id_agreement']."/transactions?start_date=".substr($logdbarray['Deal_Start'],0,10)."&end_date=".substr($now,0,10);

Here you will get a list of trsansactions. When the last transaction in not status:canceled then the agreement still runs. You will get dates of transactions as well so you can define if you agree to use your paid service or not.

like image 1
user3628218 Avatar answered Nov 02 '22 04:11

user3628218