I am trying to integrate a subscription button into one of my pages, but currently getting stuck understanding how the button works.
According to https://www.paypal.com/en/cgi-bin/webscr?cmd=_pdn_subscr_techview_outside, I have to set the following to make a donation per month
a3 5.00
p3 1
t3 M
Explanation as follows:
a3 - amount to billed each recurrence
p3 - number of time periods between each recurrence
t3 - time period (D=days, W=weeks, M=months, Y=years)
With the options stated above, a subscription is started, a payment made and shortly after the subscription expires. Paypal's detail page for the subscription says, max cycles is 1.
My assumption is that p3 sets the recurrence to 1. The payment is made, and the subscription expires as max cycles has been hit.
Another theory is, that this auto expire behavior is caused because I verified my paypal account earlier the day (~3h ago). Maybe it needs some time to propagate my new status?
I am wondering why this behavior is caused, and how I am able to set the cycles to a higher amount (permanent?).
My button code is available here http://pastebin.com/vSxVq4tf
All right, it looks like this is a bug (or missing feature?) in the paypal javascriptbuttons SDK. This behavior is caused since the src parameter is missing, that doesn't appear to be documented anywhere.
After adding src=1 to the button, subscription change from for one month to each month. I submitted a pull request and currently wait for approval by the paypal folks.
Here's a basic PayPal Standard open source subscription button setup for $10.00 once a month and never ending.
a3 = amount
p3 = number of times to bill ie 1= once a month
t3 = (when the billing takes place) ie Monthly
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="youremail#youremail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Testing Subscription">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="10.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Related
I asked these questions in PayPal's forum but I did not receive any answers. Hopefully, I'll get them here :)
So as I understand if I want to integrate subscriptions I can do it 2 ways
First one is to integrate subscription button using a form, something like this:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="businessEmail">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_name" value="Alice's Weekly Digest">
<input type="hidden" name="item_number" value="DIG Weekly">
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a3" value="5.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="notify_url" value="notify url">
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<!-- Display the payment button. -->
<input type="image" name="submit"
src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif"
alt="Subscribe">
<img alt="" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
I guess this approach has more drawbacks than benefits, it allows me to create a subscription without creating a product and a plan for the subscription..?
But on the other hand, a user that created a subscription in this way cannot change subscription, only cancellation is possible? Furthermore, I cannot change 'notify_url' if I for example change my website?
The second way to create subscriptions is to use subscriptions API. Create Product and a Plan, as I understand this gives us much more control and removes the drawbacks of the HTML form subscription.
Thank you!
Everything you said is correct, the only thing I would add is that there is also a generator you can use for the old HTML 'Subscribe' and new JS 'PayPal Subscribe' buttons at: https://www.paypal.com/buttons
If you want the old generator to create editable code, you should uncheck the Step 2 option to Save the button at PayPal, then after generating the button click the link above to remove code protection.
I'm looking to add a modifier to my PayPal Subscription button. I'd like to modify the subscription cost depending upon how many users the customer enters. Essentially, the subscribe button has a "base cost", with +$xx.xx added to the monthly subscription cost.
For example:
A user wants to create an account on my app with 6 users at $5 per user with a base subscription cost of $10/mo. The monthly cost of that subscription would be $40.
This can be achieved(may not be the most optimal solution)
Go to PayPal button designer
Moreover you are an advanced user in PayPal, you can customize checkout pages for your customers, streamline checkout, and more in this section.
I needed to build the markup as such. Then, using JavaScript I was able to assign the .val() of the item_number, item_name, and a3 fields. Works great!
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top" style="display: inline-block">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="...">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_number" monthly_item_name>
<input type="hidden" name="item_name" monthly_item_name>
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a3" id="monthly">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<!-- Send the user back here once they've completed payment. -->
<input type="hidden" name="custom" value="<?php echo $_SESSION[ID]; ?>">
<input type="hidden" name="return" value="...">
<input type="hidden" name="rm" value="2">
<input type="submit" name="submit" class="btn btn-inverse" value="Monthly" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
I'm offering a backlink building service and I'd like to just offer a simple form on my site where the user can enter their:
Website they want me to rank
And 1-2 keywords they're looking to rank for
And then a simple PayPal button that directs them to where they can pay.
Does anyone have any resources they can point me to to capture that information, maybe even their PayPal email, once they make a purchase?
Are there any plugins or code anyone knows of that I can just swipe and modify with my form fields?
I know this has to be possible I just don't know what to type into Google to get more information.
Thanks in advance.
Basically there are two parameters that comes to my mind that you could use custom & no_note
custom is a parameter that you can use to collect the Website they want me to rank information and regarding keywords you can use no_note(but this has to be entered by the buyer in PayPal checkout page.Alternaltively, you can use `custom' parameter to append both the information and then make a payment.
Sample Form Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="XXX#gmail.com">
<input type="hidden" name="item_name" value="test">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="custom" value="website_rank+keywords">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="paymentaction" value="sale">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Now, how to get this information after the buyer completes the
payment?
Use Instant Payment notification. and look at the IPN variables that you can get back
When the "Buy Now" button is clicked and the user is redirected to the Paypal.com order page the "Terms" column text for the order does not read well. It is a bit confusing to some users.
Example as displayed on my Paypal.com order page:
Terms: $25.00 USD for each 24 months
I created a test "Buy Now" button my Paypal account(not through lm_module), with a recurring billing to see how Paypal displays terms.
Example as displayed on my Paypal.com order page:
Terms: $25.00 USD for each month
When comparing both "Terms" I see that the lm_module adds the "Regular billing cycle" number to the "Terms" on the Paypal order page, and also the "Regular billing cycle units."
It looks like the output is implemented like: (Regular rate) for each (Regular billing cycle units) (Regular billing cycle)
Does anyone know how this can be edited to a more reader friendly terms?
Thank you for your support.
You can modify your form with the "a3"(amount), "p3" (interval count), "t3" (interval), and "scr" (is recurring) hidden fields:
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="5.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
NOTE: This does not work with the "hosted button".
Source: https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_subscr_techview_outside
I am using this code I found:
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="me#example.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="5.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
When you generate a button from paypal site, it gives you the option to select the link where to send the ipn. My question is, how do I get the ipn confirmation using the code above or how do I set the link for it?
To add IPN notifications to this button specifically you can just add an additional hidden field to the form.
<input type="hidden" name="notify_url" value="http://www.domain.com/ipn-listener.php" />
That will only trigger an IPN for the initial transaction, though. If you want to get IPN's for all payments associated with this profile from there on you'll need to configure IPN in your PayPal account profile under the Instant Payment Notification Preferences section. Simply turn it on and set the URL you want to use.
At that point, the account profile setting will be sort of a default IPN that your account will use for all transactions. However, this can be overridden using notify_url (or NOTIFYURL in API requests.)
Hope that helps.