How to update customer's recurring payment credit card?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had been using merchant-sdk-php to power my subscription website, where users can choose to sign up using their existing paypal account, or using their credit card. We offer 14 days free trial. Users can update their credit card when the old card expires, users can change subscription plan, etc.. These are all good for many years by simply updating the existing subscription profile (no need to cancel and re-create a new one).
Now I try to switch to paypal rest api (php). (It apears rest is newer and better?) I found there are several problems:
1. I can't do free trial. I must charge at least $0.01, otherwise it got denied.
2. I can't update anything, not credit card, not subscription plan, etc. I can suspend, reactivate, or cancel a subscription though.
Here is my test code to change only description and it doesn't work. Please help if I do anything wrong? Many thanks
[code]
// $subscr_id ( = $agreement->getId() ) is saved in my database when it was created. It is the lookup key for all later transactions
$agreement = Agreement::get( $subscr_id, $apiContext );
$patch = new Patch;
$patch->setOp( "replace" )
->setPath( '/' )
->setValue( json_decode( '{ "description": "New Description", }' ) );
$pathRequest = new PatchRequest;
$pathRequest->addPatch( $patch );
$agreement->update( $pathRequest, $apiContext );
[/code]
- Labels:
-
Recurring Payments
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Create Recurring Payment in Merchant Products and Services Archives
- Easily adding customer name to an invoice in Business Tools Archives
- Process monthly invoices for customers in Merchant Products and Services Archives
- Can someone see the total outstanding balance of all invoices I sent them? in Business Tools Archives
- Paypal Here taking authorization & payment in Merchant Products and Services Archives