Hello, I am wondering if there is an option on the Accept Hosted Form to create a subscription? In the docs there doesn't appear to be one, and I can get the create subscription call to work, but I still would have to pass along credit card information from my own form which I don't feel great about, so I was just wondering if this option exists ?
07-12-2017 03:19 PM
So after some more investigating, I've realized it is not availab.e . However I did find this in regards to making a call to create a subscription from the success of a payment:
"With Accept Hosted, using an IFrame and your IFrameCommunicator page, on a Request Succeeded, which is returned when the transaction is completed at Authorize.Net, transaction response parameters (such as transaction ID) are returned."
So I know how to set the url for IFrameCommunicator on the Accept Hosted Form, but I don't really understand exactly what I'm listening for, and there is 0 documentation I can find on it.. so if anyone could help me out, I'd appreciate it.
07-12-2017 04:15 PM
CommunicationHandler.onReceiveCommunication = function (argument) {
params = parseQueryString(argument.qstr)
var transResponse = JSON.parse(params['response']);
}
transResponse will contain something like:
{"accountType":"Visa","accountNumber":"XXXX0027","transId":"40005350406","responseCode":"1","authorization":"WF9O4R","billTo":{"phoneNumber":"1231231234","firstName":"Ellen","lastName":"Johnson","company":"Souveniropolis","address":"14 Main Street","city":"Pecan Springs","state":"TX","zip":"44628","country":"USA"},"shipTo":{},"orderDescription":"Product Description","taxAmount":"4.26","shippingAmount":"4.26","dutyAmount":"8.55","customerId":"99999456654","totalAmount":"0.50","poNumber":"456654","orderInvoiceNumber":"INV-12345","dateTime":"7/12/2017 11:58:54 PM"}"
Then you can do a createCustomerProfileFromTransactionRequest API call with the transactionId, which would be in ...
transResponse.transId
and then create a subscription with an ARBCreateSubscriptionRequest using the customerProfileId and customerPaymentProfileId.
As an alternative you could create a subscription directly with Accept.js by using:
<payment> <opaqueData> <dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor> <dataValue>PAYMENT_NONCE</dataValue > </opaqueData> </payment>
instead of:
<payment> <creditCard> <cardNumber>5424000000000015</cardNumber> <expirationDate>1220</expirationDate> <cardCode>999</cardCode> </creditCard> </payment>
in an otherwise standard API call to ARBCreateSubscriptionRequest.
07-12-2017 06:17 PM - edited 07-12-2017 06:22 PM
Thank you, google searching those functions sent me down a rabbit hole where I eventually found this and was able to implement it in Ruby:
Leaving that here in the hopes it will help someone else. They REALLY need to provide some documentation/examples for the client side javascript on this..
07-13-2017 12:09 PM
Hello @ktp925
We are actually working on just a solution you mention, the ability to use client-side JavaScript to present a form to obtain payment details and then submit the transactions to our server all without any sensitive card data passing through your server.
Stay tuned, it's coming soon :)
Richard
07-13-2017 12:17 PM
Awesome! Looking forward to it :)
07-13-2017 12:26 PM
Is there any api that will return a token for accept hosted page for creating an ARBsubscription ? or any api like such comming real soon ?
10-21-2020 03:00 AM - edited 10-21-2020 03:06 AM