Paypal, 2Checkout IPN received parameters - paypal

What are the parameters which PAYPAL and 2Checkout sends for IPN in case for buy without subscription, subscription first payment, subscription not first payment and refund.
I need understand the workflow so I can implement correct. I already checked the documentation and I already build the form for payment with/without subscription.

The full parameter list is located https://www.2checkout.com/documentation/notifications/order-created there for a non-recurring sale, use the sidebar nav on the left to find the recurring INS messages. Each INS link has a description as to when the event is triggered:
e.g. Order creation is a new order placed online by a buyer. You may want to automate inventory management, fulfillment or setup of login credentials based on this message.
Recurring order creation is a special case of order creation; if any item ordered is recurring, the recurring parameter will be set to 1, otherwise, it will be set to 0.
Please note the initial installment billed often differs in price from the installments due to startup fees.
Order Created is an invoice level message; it will be sent once for each new sale and will contain information about all items ordered.

Related

How to capture only one transaction from multiple authorized transactions?

I am building a payment system where a user can make a payment against an orderId
I want to make sure that only one payment gets through (gets captured)
The payment flow is like this:
1- User clicks on Paypal button
2- a Transaction PENDING_PAYMENT gets created for the user with orderId
3- User pays in Paypal
4- Paypal sends webhook and marks the payment as AUTHORIZED
5- The system CAPTURES the payment
as you see, the user can open multiple Paypal pages and pay all of them at the same time, there's no way for me to prevent this, but I want to be able to CAPTURE only one of these payments. (so I can automatically refund the rest of the payments)
I really appreciate any help, Thank you in advance.
When you set up the PayPal transaction for approval, pass a unique invoice_id to PayPal that has never before been used for a successful payment on that PayPal account. This could be your orderId, perhaps with some additional prefix added if desired. (For instance if you had multiple storefronts on the same PayPal account that might use the same order numbers, a prefix of 3 letters and a dash indicating the store name is a typical choice)
By default, PayPal accounts prevent (block) any subsequent payments for an invoice_id that was previously used for a successful payment on that account -- precisely to prevent accidental payments for the same thing, as is your use case.

Send part paid cart to PayPal

I need to send a cart to PayPal for payment using the FORM integration method where the cart value has already had a part payment made against it, usually by another means, like 'on account' or a gift card for example.
Is there an accepted way to do this?
The only thing I can find is sending the already paid amount as a discount amount but that's not 100% ideal as it isn't in reality a discount.
The other option I came up with was to just send a single line cart with an item of 'Balance of your order XXXX' but this is also not ideal as the customer wouldn't then see the actual items listed when on PayPal.
Many thank.
I can think of 3 PayPal features that you might possibly use to do this:
Authorization and Capture
Authorization & Capture, or Auth/Capture, allows you to authorize the availability of funds for a transaction but delay the capture of funds until a later time. This is often useful for merchants who have a delayed order fulfillment process. Authorize & Capture also enables merchants to modify the original authorization amount due to order changes occurring after the initial order is placed, such as taxes, shipping or gratuity.
Recurring Payments
PayPal Recurring Payments allows you to bill a buyer for a fixed amount of money on a fixed schedule.
Note You can also setup another form of recurring payments using reference transactions to handle payments for varying amounts of money on a varying schedule.
Reference Transactions
A reference transaction is a financial transaction from which subsequent transactions can be derived. For example, a buyer purchases an item on your site, and you use the PayPal transaction ID or reference transaction ID later to initiate another transaction. Reference transactions and billing agreements also enable you to handle recurring payments for varying amounts of money on a varying schedule.
You can read more about these features here: https://developer.paypal.com/docs/classic/admin/intro/

Order of IPN returns when setting up subscriptions

Gidday
I'm setting up several subscribe buttons on my site, each without a free trial period, so the initial two IPNs, subscr_signup and subscr_payment are sent about the same time. I'm using the custom field in the IPN to hold the user's membership ID from my site (subscription is separate from signing up for an account).
I've read that Paypal doesn't always send those two IPNs them in that order.
Initially I was going to use the subscr_signup IPN to populate the member's subscription details, but I'm wondering, am I better off using the subscr_payment IPN to do that ie check if a sub has been set up, and if not set one up, otherwise just check the subscr_payment details against the database?
The payment IPN doesn't have the recurring field, but I don't need it, as all subscriptions are recurring on my site, and I can determine the type of subscription from the amount paid.
Or, would it be better if I set it up as a 1 day free trial, so the IPNs definitely come separately?
Thanks for your time and help.
Either way should work. Another option that some merchants have done, is written all of the information to their database and set up the account before sending the buyer over to PayPal to sign up and make the payment. Then the merchants would rely on the IPN to actually activate the IPN or activate it beyond it's free trial period. You could also set up a script to check your system periodically to see if there are any profiles that are deactivated and should be removed from your system, or that never paid.

Manipulating txn_id in shopping cart for receiving Paypal IPN

My shopping cart for a ski lessons website works as follows:
A customer selects dates that they want ski lessons on. Some dates have different prices, for example school holidays and weekends. They submit the selected dates, and the event and its details is provisionally logged in an SQL table with a random transaction ID.
The shopping cart has also added up the cost of all the selected dates and creates a Paypal Advanced Buy Now Button with the price.
The customer pays for their selected ski lessons Paypal which sends an IPN back to my IPN listener for verification and to confirm the order.
There's a problem with this though, my IPN script only knows how to verify for a static price, and since every order will have a difference price depending on selection, I need to relate the received IPN to the specific order that was originally placed.
After some poking around I wondered if it is possible to manipulate the txn_id to be the same as the random transaction ID set in the first step above. That way when the IPN report comes back the script will know know exactly which event it is referring to and I can compare the details of that event (e.g. the amount paid compared to the amount calculated_ to the variables returned in the IPN report.
Is it possible to manipulate the txn_id, or otherwise send a different identifier with the Paypal button so that I can identify the payment?
It's possible to send the identifier in the "invoice" field, which PayPal will send back in the IPN.

Get Transactions associated with a Recurring Payment Profile in Paypal

I have gone through nearly all the question related to Recurring Payment using Paypal and have not found a solution to my problem.
We are implementing a system that is subscription based on a monthly basis (fixed amount). We do not want to store CC details for security reasons, hence we are trying to use Website Payments Pro from Paypal.
Once a user agrees to recurring payments, we are creating a RecurringPaymentProfile for that user and are storing the returned Profile_Id for the user.
Now we need to get information about all the transactions related to this Recurring Profile_Id. This information is available when we login to the Paypal account but this needs to be automated so that the application is aware of all the payments and also of the current subscription of the user.
We have found two methods (possibly) to implement this.
1. IPN (Instant Payment Notification, for this we will have to create a service to listen to notifications, which seems to be cumbersome and is more informational than we require)
2. TransactionSearch (but this returns transactions for the Paypal account and not Profile_Id)
Since we just want to know the transaction history associated with the Recurring Profile and whether this months payment was successful (implying the user is active member), what is the best method to implement this ?
Thanks,
You're looking for the GetRecurringPaymentsProfileDetails API Operation. This operation will allow you to view a majority of the details associated with a recurring payment profile using a valid PROFILEID.
Relevant detail fields you may be interested in:
LASTPAYMENTDATE
The date of the last successful payment received for
this profile, in YYYY-MM-DD format.
LASTPAYMENTAMT
The amount of the last successful payment received for this profile.
FAILEDPAYMENTCOUNT
The total number of failed billing cycles for this profile.
NEXTBILLINGDATE
The next scheduled billing date, in YYYY-MM-DD format.
NUMCYCYLESCOMPLETED
The number of billing cycles completed in the
current active subscription period. A billing cycle is considered
completed when payment is collected or after retry attempts to collect
payment for the current billing cycle have failed.