What is the best way to tokenize a credit card, and then charge it later?
I see that I can call getHostedPaymentPageRequest and then use the token in the response to display a page with an iframe that POSTs the token to https://test.authorize.net/payment/payment.
But, I'm having a couple of problems.
1. I'm required to enter a non-zero amount in the getHostedPaymentPageRequest. If I use transactionType=authOnlyTransaction, then it doesn't display the amount on the hosted payment page, but I assume it is going to perform an authorization, and the merchant would pay transaction fees for that transaction. Is that correct? Is there a way to tokenize a credit card without the merchant paying gateway and merchant services transaction fees?
2. When the card number is saved on the hosted payment page, it calls my CommunicationHandler.onReceiveCommunication handler with this information:
qstr=action=transactResponse&response={"accountType":"Visa","accountNumber":"XXXX1111","transid":"40011483086","responseCode":"1","authorization":"H1CB99","billTo":{"firstName":"Ellen",...,"country":"USA"},"totalAmount":"1.00","dateTime":"3/16/2018 8:30:26PM"}
parent=https://test.authorize.net/payment/payment
In order to charge the card later, I believe I would need a credit card token. Isn't that what I would pass in the createTransactionRequest request? How do I get that credit card token?
03-16-2018 02:08 PM
Use Customer Profiles.
https://developer.authorize.net/api/reference/features/customer_profiles.html
Create an empty profile
https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile
Add a payment profile using the /addPayment form action
Get the customer profile and save the payment profile id
https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile
Then when you charge, use the customer profile id and payment profile id.
If you let them edit, then use the /editPayment form action URL.
03-16-2018 03:00 PM
Thank you for this information; that was very helpful!
One more question, is it possible to default the billing address on the addPayment form using this method? I found this post:
which seems to indicate that it is not possible, but the thread is old, so I thought maybe there has been a work-around added since then. Does anyone know of one?
03-16-2018 10:21 PM