PayPal subscriptions button. Non-recurring - paypal

My understanding of the standard PayPal HTML code generated is that it will automatically ask
for a further payment in x months.
I wish to give my subscribers the opportunity to subscribe annually if they wish.At the end of this period they will need to renew their subscription (or not as the case maybe). I do not wish to go the Unsubscribe button route.
Can anyone please enlighten me with the amendment I need to make to the standard HTML script?
TIA

you will want to create a subscription button with the parameter modify=2 (2 will let only existing subscribers choose a plan). There's some documentation and sample code out there on the PayPal developer portal:
Documentation: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/subscribe_buttons/#id08ADFA00WVU
HTML Sample: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/subscribe_buttons/#id08ADFK020OJ
You may also want to refer to the HTML variable reference under https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI00JQU
The process itself should be pretty straight forward.
The SRC value will determine if a subscription will recur (will be renewed) after the end of the billing period. Also bear in mind, that your website will probably have to send out notifications if you would like to have your subscribers update their subscription.
I hope this helps - otherwise I'm afraid you'll have to clarify your question a bit.
Regards,
Martin

Related

PayPal Checkout Integration

I am hoping someone here can help me as I have been on to PayPal technical support who haven't been very helpful.
I am integrating PayPal checkout, following the instructions here: https://developer.paypal.com/docs/checkout/standard/integrate/
I wish to collect the paypal transaction ID in my database, send order confirmation emails etc... so as such I need to implement the optional step 5 described in this integration guide, which essentially means creating two routes on my server, one to call "create order" and one to call "capture order" - as per the sample code here: https://developer.paypal.com/demo/checkout/#/pattern/server
I have got this working successfully however I wish to know 2 things:
How can I see the 3D Secure flow - PayPal tell me know to worry about it as they handle it within the popup window but I would like to see the flow. I have tried test cards that should invoke the 3DS flow but they dont show any 3DS flow, just complete the payment.
The response to the capture order end point can return multiple statuses (COMPLETED, APPROVED, VOIDED, PAYER_ACTION_REQUIRED etc). Is it only the "COMPLETED" status that means a fully completed payment (and therefore I should complete the order)? What happens if it returns "PAYER_ACTION_REQUIRED" - which means 3DS check needed - will PayPal handle this and then re-execute my route?
Any help or advice would be greatly appreciated.
For the normal, 'Standard' integration, you don't have to test 3DS. The PayPal page/iframe already takes care of everything about it.
[Only for the 'Advanced' integration -- where you are implementing individual hosted card fields with your own styling -- do you need to implement and test 3DS yourself]
PAYER_ACTION_REQUIRED only happens with Advanced. All you need to do on the server end after the capture is check for COMPLETED and the existence of the Capture Id you're going to store for accounting purposes.

Is it possible to change the billingDayOfMonth of braintree subscriptions?

From the documentation it appears that I can only set the billingDayOfMonth when I create a subscription. but I don't see that option when updating a subscription.
https://developers.braintreepayments.com/reference/request/subscription/create/php
https://developers.braintreepayments.com/reference/request/subscription/update/php
Is there another way of doing this? Or do I have to cancel a subscription and create a new one? I'd prefer not to do that but not sure what my options are
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
Your initial conclusion is correct — once a subscription has been created, the billing date cannot be updated. You will have to create a new subscription, but you can specify a custom subscription ID that links the new one to the canceled one if that helps you keep track of things.

Roadblocks with using PayPal Recurring Payment Subscription with ASP.Net Membership?

I'm using ASP.Net Membership Provider for logging into the premium content of this web site. The content isn't downloads, it's web pages of information and discounts, etc. That part is done. We want them to also have a PayPal Subscription annual payment to see the premium content. I would like ASP Membership and PayPal Subscription to work together as much as possible, but for the minimum I am thinking they will have to create a MemberId before they pay. Then I will send that MemberId to PayPal to associate the two.
I think I can do that like this:
Set "Auto Return" on in the interface so that it will redirect to return URL when payment is made.
Set "return URL" query string to MemberId. This requires not using the precompiled "Saved" buttons. I'll have to set it in Code Behind with Name Value Pairs, "NVP" to PayPal. I was hoping to just paste the stupid button.
But then, there were those "Advanced Variables" in the Button maker. Problem was they are compiled into the Saved button, so I can't change them for each person. But maybe that one parameter could be separate from the compiled parameters? Is this better than hacking the return URL? Are "Advanced Variables" good for anything?
All the details about the transaction will be POSTed to the return URL if I put in the right code, which might be rm=2. (Right?) Then I can record it.
This process is said to be unreliable, though, and PayPal recommends using a secondary system that they have, "IPN". PayPal sends the transaction details to me. I send them back http 200 code. Then I send it back to them in the same order I got it. Then they send me http 200. Then we all know it's good. This sounds like a few hours research to me, but if you've already done it once, it sounds like copy and paste. I hate reinventing the wheel. Is there a .Net sample of this IPN handshake/dance?
Also, if I do the IPN thing, maybe I don't need Auto Return. Maybe I add MemberId to "notify" URL instead of "return" URL. Then PayPal can handle the confirmation page, email, etc. Is that better?
Assuming we get the Subscription paid for and recorded with the MemberId, at least once per user session, after they log in, I have to check if they have paid their PayPal subscription and if it's up to date. "GetRecurringPaymentsProfileDetails" does this, but it is an API operation. That makes sense, but I was hoping to avoid learning their REST API. (Is there a "NVP" version?)
REST API OAUTH tokens expire every few minutes, but the only way it tells to get one is by using "Bash" to "cURL" some Linux commands. Again, this seems like the kind of thing that would only ever have to be written once. Does this already exist as a sample code somewhere?
(I don't want to use the API to do the Subscribe, because I don't want the Credit Card numbers to ever go to our site. Too much liability. That's why I wanted PayPal.)
Will this even work? I know PayPal has 18 ways to do everything and they all exclude each other, and I'm just getting the feeling that I'm creating a patchwork of unrelated ideas to fool myself into believing there's a light at the end of the tunnel. I've already been researching and experimenting for 10 hours or so. I really thought, going in, I'd just be pasting a stupid button.
If you want to just "copy the stupid button" then you'll have to stick to Payments Standard, and then you'll be limited with what you can do. For example, you won't be able to use GetRecurringPaymentsProfileDetails for a standard subscription.
Instead, you'll need to use Express Checkout and / or Payments Pro. There is indeed an NVP API available for these, and there is also a SOAP/XML version. Details on those can be found here: https://developer.paypal.com/docs/classic/api/
Specifically, for Express Checkout, you'll want SetExpressCheckout, GetExpressCheckoutDetails, DoExpressCheckoutPayment, and CreateRecurringPaymentsProfile. Some of those calls are optional depending on how exactly you're configuring things with the checkout flow.
For Payments Pro you'll use either DoDirectPayment / CreateRecurringPaymentsProfile or PayFlow depending on what version they put you on.
In any case, IPN is definitely the way to go for post-transaction processing.
.NET IPN Sample - https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.asp

Implementing PayPal discounts - what if the user cancels?

Alright, I got my Paypal shopping cart set up and working, now I'd like to be able to add discount coupons.
I know I can simply implement the 'discount_amount_cart' variable in my form, but I'm still a little lost when it comes to handling the deactivation of a coupon code.
Let's say A activates the code. Now in my database it will be marked as 'reserved', meaning no one else can use it. Once A completes his transaction, the IPN will mark the code as 'used' and it becomes useless.
But what if A decides to activate the code, but never actually buys anything on my website?
I'm using the $_SESSION variable to save my shopping cart, so once the user returns to my website, the code might still be shown as activated for him. When exactly would I mark it back as 'not reserved & not used' in my database?
I could do this based on time, but this doesn't really feel safe either. Let's say the user puts everything into his basket, goes to Paypal, waits for an hour and then decides to finish his checkout. The discount would still be activated, but in the meantime, it could've already been 'unreserved' in the database and used by another person!?
How would I go about this?
Thanks in advance!
IMHO, this has little to do with PayPal and more about your business rules. If your coupon is single use (globally), then you will be faced with the same issue regardless of any payment flow.
Simply putting it in "cart" and/or any event where a user "activates" said coupon, then just navigating elsewhere in your site, doesn't do anything, [whatever], creates that lag
it could be Paypal, Amazon, your own gateway - it really doesn't matter...but there will be a lag between activation and payment (beyond your control)
I think it's just best to be explicit with your customers and handle it appropriately technically (based on what that explicit messaging is).
You'll see some implementation of "timed purchase" at ticketing sites (e.g. buying a ticket to a game, movie, etc.) - they will have a "timer" for the user to do something (otherwise, the "reservation" is lost).
Hth...
Put an expiry date on coupon use - such as must be used within 10 days of activation. It gives the user urgency to use the coupon and gives you a timeframe to invalidate it.

Make payment at PayPal before SubmitOrder

This question is based on a project done through the MvcMusicStore tutorial.
Same technologies are also implemented in my site e.g. (MVC3, Sql Server 2008 SSMS & EF Code First)
I have implemented PayPal Web Standards payment at my project. Thanks to #Arun, i have referred to his site here http://www.arunrana.net/2012/01/paypal-integration-in-mvc3-and-razor.html
Situation at MvcMusicStore:
My project is similar to the data flow of MvcMusicStore. As you can see in this link, http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-9
In this tutorial, Jon Galloway has inserted a Payment field in the AddressAndPayment.cshtml page (but for simplicity purposes he made all products to be purchased for free by typing the keyword 'Free' - which would allow the user to checkout by clicking SubmitOrder and saving the Order in database)
Situation at My Project:
My question is about the workflow that i intend to apply.
When user adds items to shopping cart and reviews items in the Cart.
I want to:
Redirect user to PayPal to make payment upon clicking Checkout
After User make payment, return the user to AddressAndPayment.cshtml page
User then enters information and submit order
Is this work flow even right to begin with?
If yes, how do i convert these variables from my project;
Product.Title
Product.Quantity
Product.UnitPrice
to match these PayPal variables?
Item_Name
Amount
Quantity
Well i figured it out myself.
My first question, "Is this work flow even right to begin with?"
I have implemented it successfully. I cant say it is 100% right way of implementing it. It depends on your own system workflow. As for MvcMusicStudio, i cannot think of any other methods than this.
As for the second question, all i did was call a foreach loop and looped the PayPal variables. You will see it in more detail on Arun's website (link provided in the question thread above).
Thank you.