Payflow Pro SDK - Authorized Transaction using OrigID - paypal

I need to create an Authorized transaction but instead of using the credit card number I need to use the OrigID which was generated from a previous payment? Is this possible if so how would I achieve this?
Customer places and order -> Authorization is done using the credit card number
Order is shipped and invoiced -> Payment is captured using a reference transaction.
Same customer places another order -> instead of having to get the credit card details - use the "token" generated from the first transaction (while it is still valid).
Hope this makes sense.

You can use the transaction id that is generated from the first transaction to process additional transactions for the buyer without having to have the buyer enter in their credit card information again. You would need to enable reference transactions on your account, and store the transaction id's on system. Then when you want to charge a buyer again, you would just pass over the transaction id of the previous transaction instead of the credit card information.

Related

Using PayPal Payflow Card on File feature for future recharging with their API

I am trying to save credit card info so I can allow my users to recharge saved cards for subsequent purchases via the PayPal Payflow Pro API.
There seems to be a stored credential transactions feature with examples of how to indicate a CARDONFILE transaction, but I don't see anything about how to then recharge that card later without having the card number.
Here is an example of the a Card on File request and response...
TRXTYPE=S&TENDER=C&AMT=9.95&ACCT=4012000033330026&EXPDATE=0125&VERBOSITY=HIGH&STREET=100 SOUTH NORTH DR&CITY=NORTHWOOD&STATE=NH&ZIP=03275&CVV2=987&CARDONFILE=CITR
RESULT=0&PNREF=AS0O0D64E7C2&RESPMSG=Approved&AUTHCODE=010203&AVSADDR=Y&AVSZIP=Y&CVV2MATCH=X&TXID=X1Y2Z3100026810&HOSTCODE=00&RESPTEXT=APPROVAL&PROCAVS=Y&PROCCVV2=X&VISACARDLEVEL=A&IAVS=N
Notice on the end there is &CARDONFILE=CITR, this seems to indicate for PayPal that this is to be a card on file.
But then how would I recharge this card for a later purchase?
Thanks in advance for any help
You are describing reference transactions, so according to the Payflow documentation there is no need to specify CARDONFILE. It is handled for you.
To use reference transactions, save the PNREF of an initial sale transaction, delayed capture, or zero dollar authorization -- and reference it in the future for a new sale (TRXTYPE=S) with ORIGID instead of ACCT
Note that to use reference transactions they must be enabled in the settings of your Payflow Manager, and you must wait up to 1 hour after making changes to those settings.

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.

PayPal Converting Sale transaction to Recurring Billing Profile results in Duplicate error

Using payflow .net dll I am trying to create a Recurring Billing Profile without forcing my clients to take on the PCI compliance burden of handling credit card data so here's what I'm currently doing...
get secure token
create sale transaction (record results)
Convert it to Recurring Billing Profile (starting in the future)
This all works however when PayPal tries to create a transaction using the RBP it gets Result Code 30, Duplicate, error 10536 - ...duplicate invoice id... I'm not setting an invoice id anywhere in my code. When in step 2 I create an authorization instead of a sale it works (although the trans type in the IPN ends up being "cart"???). So I assume this is a problem with converting a sale to a RBP. If that is not allowed then step 3 should stop me but it doesn't. So is there a way around this problem?
NOTE: When using Express Checkout with the paypalcoresdk and paypalmerchantsdk dlls I am able to create a sale transaction AND a RBP using the same token and it all works and the IPN tran type ends up being recurring_payment which is correct.
NOTE 2: The best solution would be for PayPal to allow me to create an RBP using a secure token. I have not been able to make that work.
NOTE 3: The reason I'm not using an Authorization transaction is because this would result in the client having loads of Auth transaction in PayPal that they could Capture at anytime resulting in duplicate payments.
To get rid of this error , Login to your Paypal account , go to Profile --> My selling Tools --> Block Payments . Here you will see something like " Block the payments with same invoice id " , put it to "No" and save the settings . It should be fine afterwards .
Regarding NOTE 3
I have found that I can set up an Authorization transaction with an amount of 0. Then in the transaction history it will have a status of Completed and no Capture button. Then when converting this to a Recurring Billing Profile PayPal allows you to set a different amount. I don't know if this imposes a limitation on the amount but my test of $500 worked.
Hope that helps someone

Can I change a credit card while using reference transactions?

I want to use reference transactions and give the option to users to change their credit card. It looks like there are required fields like amount that don't apply and can't be zero.
Hopefully I can set it up so:
-User enters credit card info
-I can charge that card different amounts at different intervals
-Invisible PayPal (no express checkout or PayPal billing agreement
-User can change credit cards on my site.
Any ideas, or links to some documentation that can help?
If you want them to be able to update their card details then you'll need to run an Authorization against their new card and store the transaction ID you get back from that as the new ID to use within reference transaction requests.
You could just authorize $1.00 and then immediately void it, for example, to update your system with their new card.

Store a credit card with PayPal payment buttons

Is there a way to integrate /vault/credit-card call with PayPal payment buttons? I do not want to work with client credit card information but i can't find a way to redirect the client to paypal only to store his credit card information and for me to get his id on paypal to charge him than needed
You could use the PayPal/Payflow hosted checkout pages and process a 1.00 authorization. Then store the transaction id on your system. Then when you want to charge the buyer, you would just use the reference transaction API call to charge them. You only need to pass over the amount you want to charge along with the previous successful transaction id, and PayPal will use the same credit card information that was used in the last transaction.