cancel
Showing results for 
Search instead for 
Did you mean: 

Using Accept.js hosted form to process Subscription/Recurring payments

I see post about this subject, but they are all older posts.   Is their an update for using the Accept.js to process Subscription/Recurring payments.   

Anyone?

jlhutto
Member
7 REPLIES 7

Hi @jlhutto

 

You can use the Accept.js token to create a subscription . 

 

https://developer.authorize.net/api/reference/features/acceptjs.html#Using_the_Payment_Nonce_in_an_A...

 

<ARBCreateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>3kFew5Z8Ra</name>
<transactionKey>8y25f3QT9qj3A6uh</transactionKey>
</merchantAuthentication>
<refId>123456</refId>
<subscription>
<name>Sample subscription</name>
<paymentSchedule>
<interval>
<length>1</length>
<unit>months</unit>
</interval>
<startDate>2020-08-30</startDate>
<totalOccurrences>12</totalOccurrences>
<trialOccurrences>1</trialOccurrences>
</paymentSchedule>
<amount>10.29</amount>
<trialAmount>0.00</trialAmount>
<payment>
<opaqueData>
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
<dataValue>eyJjb2RlIjoiNTBfMl8wNjAwMDUyNUMxREY1NEVGNDBGQkNDNDdCNTk3QjI2QzI5MjAzNUJEOTUwRTQ3MjBCMTJDODM2NDk2NDhBMTgwNjg4RTlENTZGMDg5RTE1MEJGMjI4Q0U0NkJCMzQ3QzcwODk1QjE5IiwidG9rZW4iOiI5NTI3ODM1MzMxMzgzOTQ5MTA0NjA0IiwidiI6IjEuMSJ9</dataValue>
</opaqueData>
</payment>
<billTo>
<firstName>John</firstName>
<lastName>Smith</lastName>
</billTo>
</subscription>
</ARBCreateSubscriptionRequest>

 

 

Thanks

Anurag





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

I set it up but Now I'm getting this error.

 

E00114 Invalid OTS Token

 

Hello @jlhutto

 

An E00114 error typically occurs when you attempt to use an Accept nonce twice.  If you need to make multiple transactions, you can:

 

1. Set the createProfile flag on createTransactionRequest.  If the transaction is successful, a customer profile is created which you can use for subsequent transactions.

2. Create a customer profile first using the Accept nonce and then use the customer profile to create subscriptions, transactions, etc.

 

Richard

Thanks for the reply... .  

 

I'm using the accept.js hosted payment page.   Then processing using the createTransacationRequest.    I don't see a createProfile flag.   

 

I found it in the chargeCreditCard api.    

 

I'm trying to stay in the SAQ A compliance and that requires me to just accept.js hosted form.

Is thier anyway other than creating the customer profile first?
I hate the idea of not knowing the credit card is good before creating the profile.

 

 

@jlhutto

 

If you are using AcceptUI, and the payment nonce returned to create a transaction, you can set create profile:

 

profile The following field enables you to create a customer profile from the data sent to make the transaction.

 
createProfile Indicates whether to create a customer profile.

If set to true, a customer profile and payment profile will be generated from the customer and payment data.
Boolean.

Either true or false.

 

If your transaction is successful, it will contain a customer profile which can be used to create a subscription.

 

OR, if you only need to create a subscription but not immediately process a transaction, you can just use the nonce to create a subscription which will run on the date you specify.

 

Richard

I've been able to setup the profile using the information you provided. 

But if the customer already has a profile, it doesn't return the profileID.   

It just send the error.   

 

How can I get the ProfileID if they already have one?

I'm having a similar problem; I am using an integration not the hosted form.

 

When I pass the Accept.js token to charge a card once, it works fine. But when I use the token to create a subscription, it give me the E00114 error.

 

I am not currently attempting to create a profile, as our app doesn't use customer logins or profiles. I am also not trying to use the token for multiple transactions.

 

Do I need to create a profile for this? Is there anything else that could cause the E00114 error besides attempting to use the token twice?

russunit
Member