Reply
Member
Posts: 9
Registered: ‎04-25-2017

Accept Hosted Form to Create Subscription

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 ?

Member
Posts: 9
Registered: ‎04-25-2017

Re: Accept Hosted Form to Create Subscription

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.

Posts: 138
Topics: 0
Kudos: 27
Blog Posts: 0
Ideas: 0
Solutions: 9
Registered: ‎04-28-2017

Re: Accept Hosted Form to Create Subscription

[ Edited ]

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.

Powered by NexWebSites.com -
Certified Authorize.net developers
Member
Posts: 9
Registered: ‎04-25-2017

Re: Accept Hosted Form to Create Subscription

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:

 

https://stackoverflow.com/questions/43700622/how-to-implement-authorize-net-hosted-payments-iframe-l...

 

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..

Posts: 2,319
Topics: 51
Kudos: 157
Blog Posts: 65
Registered: ‎12-05-2011

Re: Accept Hosted Form to Create Subscription

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

--------

Webhooks are now available for Authorize.Net

Using SOAP, see our deprecation notice.
Check out Accept.js, our Javascript replacement for DPM.
Pro Tip: Never use test mode in the sandbox, instead use the Testing Guide.
Member
Posts: 9
Registered: ‎04-25-2017

Re: Accept Hosted Form to Create Subscription

Awesome!  Looking forward to it :)