So I've implemented PayPal fully into my system. The system works on user 'packages', all at set prices. Each user has a subscr_id (set by PayPal) assigned to them, along with details of the package they've bought.
I need to be able to modify the subscription so the user can select a different package. Essentially I just need to be able to change the amount and the 'custom' field (this contains package details, coupons used, etc).
I would have thought, and hoped, that it would be as simple as showing the user another form with hidden fields for 'modify', 'subscr_id', 'custom' (new value) and 'amount' (new value). Unfortunately I can't find this anywhere online, and PayPal's documentation is so monolithic that I find myself going round in circles for hours at a time.
My IPN is all set up and working fine, I literally just need to build a form that allows me to set the 'amount' and 'custom' variables to something new... the bit I thought would be easy! Any help is greatly appreciated. Thanks in advance.
I've been looking into this recently. You can create a "Modify Subscription" button to change subscription details such as amount and period. When the user clicks this button, they login and see the old subscription details and the new subscription details, and must approve/save it for it to take effect. One major issue though is you can only increase the subscription amount by 20% within a 10-day period.
To create the modify subscription button just use the regular subscription HTML button with the new parameters you want, and add an extra parameter "modify=2" (2=modify only, 1=modify or sign up).
Also I think that the custom variable field does not change even if you modify the subscription, but I am not 100% sure on that.
After a wee bit of searching, hopefully this will help:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_subscribe_buttons#id09A7G0502UI
If you became a PayPal Merchant after October 15, 2009, you can edit a buyer’s subscription profile.
As a subscription service provider, you can edit a buyer’s subscription profile in the Edit Profile page. Use this page to update buyer information, adjust the cost or cycles of the subscription, and specify how to handle missing or failed payments.
Related
So I am dealing with Authorize.net's ARB, and I have a situation where the user is applying for usage of our service for eg. 3 months. We charge the user for this period - 3 months, but we don't make a subscription immediately. The thing is, we don't want to automatically charge them again once the membership expires after 3 months, but only if they go to account settings and set that option (extend membership automatically). So if they don't select it, there is no need to establish a subscription, so that's why we aren't doing it in starting point, once the user applies for this service.
So the question is, should I create a new subscription once user selects "Yes" for that option, and delete the subscription when he selects "No" ?
Is there another way to do it?
It's really hard to find some answers by Google, and I was hoping someone with more experience will have an answer here.
Thanks in advance.
When the user selects "Yes" for the new subscription just create a new ARB subscription with a start date of three months past their three month trial period. The three month subscription will run its normal course and terminate after three months. Then the new subscription will start at that point.
But here's the catch with that solution: you need the customer's credit card information in order to recreate another subscription. Unless you store it somewhere (bad idea) you can do that. So you would need to ask for it again. That's a large hurdle to overcome and will negatively affect conversion rates.
Alternatively you can automatically create the three month subscription at the point where the user starts their three month trial. As they approach the end of the three month trial you should make them aware there subscription will automatically start unless they cancel it. This solves the creation of the subscription problem but isn't very popular with users as nobody likes being automatically enrolled in a subscription.
Third option is to use Authorize.Net's CIM API to create a payment account for that user. Then you can charge against their card whenever you want. The problem with that is CIM does not support subscriptions. So you'd have to write your own subscription engine to make this work.
So there is no ideal solution for this. You just need to pick the one that you think works best for you.
This is my first time interacting with Stripe and trying to tie it into CodeIgniter.
Currently, when you create an account on my application it adds you to the correct Stripe plan and increases the total amount to be billed on that account.
I'm having a problem trying to work with this subscription plan #. I found in their documentation that this deals with the Subscription plans quantity.
What I need to happen is when you deactivate a user, it needs to update the quantity to 1 less. I can't figure this out.
Playing around with their API I was able to completely delete a subscribed customer by doing:
$this->load->library( 'stripe' );
$this->stripe->customer_delete('cus_1WS0pth6srNf7H');
Now I'm working with:
$this->load->library( 'stripe' );
$customer_id = $company->stripe_id;
$this->stripe->customer_update($customer_id, **WHAT GOES HERE?**);
Any help would be greatly appreciated. To sum this up, I need to update the quantity of my plan to -1 when a user is deactivated. The user is being deactivated fine in my application, but now I need to send a request to Stripe to update my plan to 1 less user.
Perhaps the customer_update function isn't the right one to use for this? There are a lot in the Stripe.php file.
Once I have this solved I can handle applying it to reactivating a user.
Here is the documentation where I think I need to be
I've been using Jason Horwitz's fork of bcessa's php-stripe library. It appears to be kept up to date with Stripe API changes.
https://github.com/sekati/php-stripe
Anyways, this is what I did for applying a plan to a customer
$request = $this->stripe->customer_subscribe( $stripe_id, $plan );
According to Stripe's API Docs, this will prorate the difference (if changing from one plan to another) by default so if that's what you want, you're good. If not, you can add it to the options array like so:
$request = $this->stripe->customer_subscribe( $stripe_id, $plan, array('prorate' => false) );
Not clear if you are using this library or not, but you should check:
https://github.com/bcessa/php-stripe
Written for CI & very simple. I'm going to assume you are.
According to Stripe support (I did this exact same thing recently), you need to actually make a unsubscribe & resubscribe to a new plan.
The steps I want through, roughly, were:
1) Get next invoice - so I could capture the next billing date for the new subscription (we used a trial period, so I needed this. you might be able to skip)
2) Unsubscribe the customer
3) Get my new total user count
4) Create a plan id (can be the same as you had before, I believe)
5) Subscribe with the new count to the new plan
6) Update anything on your own db
The situation is like this,
I have three kind of user registration on my site
$20/month
$30/month
$40/month
now, suppose a user registers with $30 amount and takes the 2nd registration...
next 2 months his $30 per month were deducted as per the recurring payment of paypal...working fine .:)
Now, he wants to upgrade to $40 i.e 3rd membership , so from next month his amount deduction should be $40... How to update paypal for this change in amount..
I DON'T WANT TO GO TO PAYPAL'S SITE FOR THIS...
Is there any API for this purpose.......
Any help would be appreciated....
First off, Paypal's API is not a simple or easy thing to use, but what you're asking can be done. It is simply a matter of canceling the existing 'recurring payment profile' via the API, and starting another recurring payment that ends at the same time.
The API methods themselves change depending on which system you are using. At my company, we use Paypal Website Payments Pro. This has a specific set of functions to perform actions. Without knowing which system you use, however, we can't give any further advice.
The below link shows a number of the methods for the different Paypal API's. Do your research, and try to ask specific questions. :)
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_reference
Daniel Moniz
I was able to do this, but first, this caveat from PayPal should be noted:
Note: For recurring payments with Express Checkout, the payment amount can be increased by no more than 20% every 180 days (starting when the profile is created).
Since I'm not using Express Checkout, POSTing this worked for me to change an amount from $75 to $200 (the credentials are fake):
TRXTYPE=R&TENDER=C&PARTNER=PayPal&VENDOR=Acme&USER=Acme&PWD=a1b2c3d4
&ACTION=M&AMT=200.00&ORIGPROFILEID=RP0000001234
The other caveat is that this is only one of I-don't-know-how-many APIs and I-don't-know-how-many-types-of-accounts (in this case Payflow) that PayPal has, and I don't know if something similar works for all of them. The above code is actually copied almost verbatim (credentials and amount changed) from https://developer.paypal.com/docs/classic/payflow/recurring-billing/.
My company is providing service, which has few subscription plans with different monthly fee. Everything is working via PayPal recurring payments.
I want to implement upgrade system, so clients could switch to more expensive plan.
For now I found two solutions:
Modify current subscription and ask for payment to cover difference in plans to the end of the month (modified subscription will work only from the next month). So basically I need to give my client two different forms to submit to PayPal, which is very bad.
Also I could cancel current recurring payment and ask client to subscribe for new. Cancel is possible in the background without any user interaction, he only need to submit new form for new payment.
I like second method more, but it still not very clear for users and I'm looking for better solution.
Sounds like option 2 would be the only viable one.
For upgrading have your script put them on a new subscription, then on your script that processes the PayPal reply, have it check to see if the user already has a subscription, if they do, then create a paypal request to cancel the old subscription.
Although this is a very old question, I found it while trying to implement this kind of upgrade and I believe might be interesting for other people.
Now, you can upgrade paypal subscription amount programatically. More info here:
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-recurringPaymentProfile-curl-etc/
https://developer.paypal.com/docs/classic/api/merchant/UpdateRecurringPaymentsProfile_API_Operation_NVP/
However, this has the limitation that you cannot upgrade more than 20% of the current amount for half a year. In my case, and probably many others, the best option is to cancel the current subscription once the new subscription has been approved.
If you need to start charging the subscription next month, it can be easily achieved with the starting date parameters or giving a free trial.
I want to integrate paypal with my website.
I have studied the documentation available on paypal website.
My requirement is
A user selects a category, based on category course is populated,user selects course and discount. I want the user to pay through paypal according to the course selected. Also the data should be inserted into a table after successfull payment.
I have checked sample code also but i am unable to figure out how to accomplish this task ie how to make it dynamic according to the user choice. I think ipn would be used but not sure.
Plese help
Thanks
I don't think there is an option for that. Only configured prices.
The only field that doesn't have an price setup is "Donations"
Also in PayPal you can configure the stock that you have for every products, shipping price and tax.