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

2

7

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.

Jat answered 16/3, 2015 at 15:21 Comment(0)
F
3

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-...

...

Forsythe answered 7/9, 2015 at 13:22 Comment(2)
Then why oh why are there Recurring Payment buttons which serve absolutely no purpose? I have been banging my head against this for three days. I have a Recurring Billing button. I use the button to create a recurring billing profile. This is verifiable in the IPN I get back from PayPal: txn_type = recurring_payment_profile_created When I try to set the balance so I can bill this via the API I get the error: "Subscription Profiles not supported by Recurring Payment APIs." I can bill the customer from PayPal web site but not via the API because this "feature" is not available!Ferrocene
This is explained in some detail at developer.paypal.com/docs/classic/express-checkout/…, but to the left of this page we are told that the NVP/SOAP checkout API is deprected! So we have one method that doesn't work and one method that is deprecated. What do the engineers at PayPal smoke for breakfast?Ferrocene
A
1

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.

Attainture answered 3/1, 2019 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.