paypal IPN initialization - paypal

I am trying to build a form in which a user selects one of two pre-defined subscription packages (And they are also already setup on my paypal account), and when they select one and submit the form, it directs them to the correct paypal subscription registration page. I have tried checking the documentation to see how the POST needs to be assembled so when the form is submitted it directs them to the correct page, but I am unable to find any documentation pertaining to this step.
i already have my IPN listener implemented and working (as tested on the ipn test tool and the sandbox), but I can't seem to find any documentation pertaining to how to assemble the URL to send the user to when they submit the form.
(For example, from a 'button maker' tool on the paypal site, I got this link:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MP6PZTT
But, I can't find in the documentation anywhere where that's assembled, and what MP6PZTT refers to in the paypal account.
Is there anyone that can give me some information on how the URL needs to be assembled so that when the user selects a button than submits the form, it puts the correct information in the URL for that subscription.

Related

I can't find out transaction history in sandbox use paypal checkout-sdk

I use java checkout-sdk-1.0.4 to develop PayPal payment. I successfully submit an order to PayPal, get the payment url.
I log in with personal account and click the continue button.
And then paypal just redirect to the url i set.
http://localhost:38001/checkout/submit/result?token=60X99286YV4394812&PayerID=9WXE2YPSNEJSN
I can see the api call history in developer dashboard.
But i can't see any transaction history in my business account and personal account.
How do I determine if my payment is successful。
I try this tutorial from here
https://developer.paypal.com/docs/business/checkout/server-side-api-calls/create-order/
https://developer.paypal.com/docs/business/checkout/server-side-api-calls/capture-order/
At the end, paypal return capture success.
Status Code: 201
Status: COMPLETED
Order ID: 1AL061567P026410J
Links:
self: https://api.sandbox.paypal.com/v2/checkout/orders/1AL061567P026410J
Capture ids:
6NY33838LX3268618
But i still can't see transaction history in my personal test account.
But I can't see any transaction history in my business account and personal account. enter image description here
You can't see any transaction because there is no transaction. There won't be any, unless you show the required order review page and perform the required capture API call when the customer returns to your site. (if you want to skip showing a review page and proceed directly with making the API call, then you should set the application_context object's user_action to 'PAY_NOW', so the last button's text is changed from 'Continue' to 'Pay Now' and the user knows to expect no review page. You still need to perform the API call to capture regardless).
The flow you are using of redirecting over to PayPal and then showing a review page or doing a capture call after being redirected back, is an old checkout flow and does not provide the best user experience. It is better to not use any redirects. At all.
Instead, make two routes on your server, one for 'Create Order' and one for 'Capture Order', documented here. These routes should return only JSON data (no HTML or text). The latter one should (on success) store the payment details in your database before it does the return (particularly purchase_units[0].payments.captures[0].id, the PayPal transaction ID)
Pair those two routes with the following approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server

Submit a Listing Form and Redirect To PayPal

I need help please.
I have a WordPress business directory that the subscriber completes the listing form and clicks submit which goes to admin for approval to advertise their business on my website. Please see link
https://mercatoposto.com/submit-listing/category/
I have added PayPal plugin for them to pay after listing, clearly shown on the user account page, however this is totally ignored and they logout.
Is there a way that when the form is submitted to admin, the subscriber is redirected to PayPal gateway to pay? I want it that they cannot logout of the website until they complete the transaction.
Appreciate a responsive code please, many thanks.
Regards,
Tina
I want it that they cannot logout of the website until they complete the transaction.
Sure, just install a WordPress plugin that forces a browser logged into your site to remain open and displayed on the user's device until they make a PayPal payment....
What you are asking for makes no sense at all.
On approval of something unpaid for, send them an email informing them that what they submitted won't provide any service until they make a payment, and in such an email have a link to where they can make that payment.
To your earlier question of wanting to redirect them after they submit a form, that is also possible. It'll have to be done from whatever the WordPress page is after they submit that form. Of course, just because you redirect them does not mean they will pay.

When are PayPal Checkout redirect urls used

I'm trying to implement the PayPal checkout server flow described here and I'm a little bit confused about the role of the redirect urls required by the Create Payment REST API
With the PayPal checkout JavaScript components, I need to provide a onAuthorize hook in the JavaScript button initialization code like in the example on the page linked above. My understanding - and I've confirmed this in the sandbox environment - is that this callback gets called after user has successfully authorized the payment on PayPal and in this callback I'm supposed to execute the payment. This part is pretty clear and I've successfully implemented this. The confusion arises from the payload on the PayPal's Create Payment API.
This API expects a required parameter redirect_urls to be provided in the payload. Under this both return_url and cancel_url have to be provided. I understand from the documentation these URLs are where the user will be redirected after successfully authorizing the payment or if they cancel the payment.
In my tests in the sandbox environment, however, the user is never redirected to these redirect urls, as the "return" / "cancel" is handled by the callbacks provided to the button initialization. Now this leads to my question:
Despite this, is there any scenario where the user is redirected to these urls? What should happen if the user is redirected to these urls?
My concern is do I need to duplicate the on authorized / cancelled logic both in the JavaScript code and then upon entering the provided return urls?
The return and cancel url were important in cases where the PayPal experience is not in context (light box ) or if you want to take them to a completely different page once they approve the payment using continue or pay now or if you are using this in a mobile app where the checkout.js won’t work
With the checkout JS integration you don’t really need to pass the url as the experience is in context if that’s what you were trying to ask.

Paypal Cancelation - Recurring Payment

I have googled this for a while and I don't think I was able to get a clear cut answer.
We have an application that displays a Subscribe button. Once clicked, It takes the user to the Paypal website where s/he can complete the txn.
Later on, Paypal sends an IPN to our site indicating whether payment was successful. This integration is done by setting hidden html variables.
Now, there is a need to allow the user to cancel their subscription. So far, most of my readings indicate that the user must login to paypal and manage his/her subscription there.
In addition to that, I was able to find some other people mentioning that It would work with using CreateRecurringPaymentsProfile.
The problem is that the later requires ProfileId which is returned thru CreateRecurringPaymentsProfile. it looks like there is a gap. I would appreciate if somebody can pinpoint to the right direction.
Thanks,

Choosing the right Paypal system for processing registrations and subscriptions

The payments we gather on our website are for online subscriptions and registrations for conferences. In both cases, we want to gather absolutely all information other than the payment information ourselves, and ideally pass some of it on to PayPal (so users don't have to fill in name, address, etc. twice).
I know there are solutions where the information is gathered by the server itself and then redirected to PayPal via a web services call but that's not an option, unfortunately. All secure payment information gathered has to happen off-server due to network policy.
In addition, not every form will need to be processed using PayPal. Some people will be paying via check, etc. so they shouldn't be sent to a payment page at all. Most solutions I've looked at have a "Pay with Paypal" button, so I assume a form post is necessary to go to the PayPal site, but ideally we'd want to get there via a 302 redirect. Is that at all possible? (I'm aware we could do something like a form that was auto-submitted by JavaScript but I'd prefer to not go down that route).
Whichever system we implemented would need to handle recurring (periodic) payments also.
Paypal has something called Payflow Pro. They bought it from VeriSign a few years ago.
You can use it to do a full integration with the paypal api. So that the user enters their payment details on your site, and your backend code submits the transaction to paypal's servers. Paypal will then give you a transaction id back. Keep the transaction ID, chuck everything else (like the card number) out the window.
We have several clients that use Payflow Pro. It's very good and easy to use api.
I'm not entirely sure I understand the full scope of your question, but I think I do. I've coded a number these conf. registrations (though I have not interfaced with PayPal...rather iTransact and Plug'NPay) and in my applications, I had to read through the API documentation for the system being used (PayPal in this case). Then I logged into the payment gateway and usually they have an html form generator. All this does, of course, is returns an html form with the fields labeled appropriate to their API (so the billing name and address carry over from your system to PayPal's and the user doesn't have to re-enter their information), shows you what hidden fields you'll need(like cutomer_id, etc) and the form POST path.
Then what I do is I have the user register, preview their order details on another page (where you can choose to drop their info into a DB or wait until AFTER their credit card is processed) and then upon confirmation, they go to PayPal, pay with either credit card OR check (the options always exist) and when they hit confirm, the passback URL you put into a hidden var somewhere, takes you to a custom Thank You page (and hopefully processing script to capture successful transactions) which can be hosted anywhere on your servers.
It's pretty simple, just a bit labor intensive at first as you try and figure out the new form variables specific to a payment gateway API.
Hope this helped!