cancel
Showing results for 
Search instead for 
Did you mean: 

Create ARB Subscription via Opaque Data (from Accept.js)

So our application is a website that is built on ASP.NET.


The front end is JavaScript and the back end is C#.

 

We are using Accept.js on the front end to create two nonce tokens (1 for the ARB sub, 1 for the 1 time transaction).  I realize this might not be the best way to do this with two separate transactions but it is what we have for now.  This was actually working yesterday until after around 5pm.  Then we started getting the E00114 Invalid OTS Token error message every time we tried to create the ARB sub.  The 1 time transaction would work just fine.

 

So we tried flipping the nonce values in case the one we were trying to use for the ARB sub was wrong but even after swapping them to use the other one the 1 time transaction worked but the ARB sub did not.  This validated that the nonce values appear to be working fine.  We talked to Authorize.net support and they informed us that the error message E00114 could also be returned if the data sent to create the ARB sub was not valid even if the token was valid.

 

Can anyone help me diagnose or validate the ARB create transaction we are sending to Authorize.net?  I have read some people reference the ability to capture the XML being sent to Authorize.net via the SDK but since I am using the nuget package (v1.9.1) I'm not sure how to turn this option on.

 

Any help would be greatly appreciated.

pmgower
Member
27 REPLIES 27

Your first scenario is our preferred method, but that is what is returning the non-supported error to me.

 

Here is my code for the first payment, which attempts to set up a customer profile if the gift is a recurring donation.  Please tell me what I'm doing wrong.

 

Tim

 

------ snip -----

public static CreateTransactionResponse oneTimePayment(

OutboundDonation outboundDonation, Payment payment) throws Exception {

CreateTransactionResponse response = null;

try {

if (GiftServiceUtil.getProperty("environment").equals("prod"))

ApiOperationBase.setEnvironment(Environment.PRODUCTION);

else

ApiOperationBase.setEnvironment(Environment.SANDBOX);

 

MerchantAuthenticationType merchantAuthenticationType  = new MerchantAuthenticationType() ;

merchantAuthenticationType.setName(getAPILoginID());

merchantAuthenticationType.setTransactionKey(getTransactionKey());

ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);

 

// Populate the payment data

PaymentType paymentType = new PaymentType();

paymentType.setOpaqueData(payment.getOpaqueData());

// Create the payment transaction request

TransactionRequestType txnRequest = new TransactionRequestType();

txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());

txnRequest.setPayment(paymentType);

CustomerProfilePaymentType cppt = new CustomerProfilePaymentType();

cppt.setCreateProfile(true);

txnRequest.setProfile(cppt);

ArrayOfSetting settings = new ArrayOfSetting();

SettingType setting = new SettingType();

setting.setSettingName("duplicateWindow");

if (outboundDonation.getRECURRING_GIFT() != null && outboundDonation.getRECURRING_GIFT().equals("TRUE")) {

txnRequest.getProfile().setCreateProfile(true);

setting.setSettingValue("0");

} else {

setting.setSettingValue("30");

}

settings.getSetting().add(setting);

txnRequest.setTransactionSettings(settings);

txnRequest.setAmount(new BigDecimal(payment.getAmount().replaceAll(",", "")).setScale(2, RoundingMode.CEILING));

txnRequest.setPayment(paymentType);

OrderType order = new OrderType();

order.setInvoiceNumber(outboundDonation.getX_INVOICE_NUM());

txnRequest.setOrder(order);

 

CustomerAddressType addr = new CustomerAddressType();

String billFirstName = payment.getBillToFirstName();

String billLastName = payment.getBillToLastName();

 

addr.setFirstName(billFirstName);

addr.setLastName(billLastName);

txnRequest.setBillTo(addr);

txnRequest.setOrder(order);

// Make the API Request

CreateTransactionRequest apiRequest = new CreateTransactionRequest();

apiRequest.setTransactionRequest(txnRequest);

CreateTransactionController controller = new CreateTransactionController(apiRequest);

controller.execute();

response = controller.getApiResponse();

} catch (Exception e) {

log.error(new Date().toString() + " - Error executing oneTimePayment.", e);

e.printStackTrace();

throw e;

}

return response;

}

 

----- snip -----

Hi Tim,

 

To clarify, that first scenario is to first do a seperate API request to do the one-time transaction (without the createCustomerProfile flag). Do that one just as if it was a one time transaction using a nonce where you weren't planning on creating a profile, nor planning on creating a subscription.

 

Then, once that transaction's successful, use the createCustomerProfileFromTransactionRequest to create a profile. You pass in that call the transaction ID you got back from the one-time transaction. Our system will look at the data used in that transaction, and create a customer profile out of that data. It will return a profile ID, payment profile ID, and address profile IDs if you sent address info with the original transaction.

 

Then, once you have a profile, you call the ARBCreateSubscriptionRequest call, but passing the profile IDs instead of payment information.

 

To recap:

  1. Get a nonce.
  2. Run the one-time transaction using that nonce in place of the creditCard data (no createCustomerProfile flag).
  3. Create a profile from that transaction (send transaction ID to createCustomerProfileFromTransactionRequest).
  4. Create a subscription from that profile (ARBCreateSubscriptionRequest).

@steve074 -- we have an escalation from you already, and if I can get some timestamps, a traceroute (to verify routing) and if at all possible, a Wireshark PCAP file, I can escalate this further. I believe you are already in contact with us through developer@authorize.net, but if not, you can email that address to provide the information we need.

--
"Move fast and break things," out. "Move carefully and fix what you break," in.

Hello, I am digging in further. Please refer to the serial charge / ARB set up test from my ticket. Even running serially, I get two responses back from the

Accept.dispatchData. The first response is an OK status, with a nonce. The second follows later in an asynchronous fashion and is an error E0014 Encryption Failed error.

 

On March 12, it appears you made a significant upgrade on your end:

 

https://account.authorize.net/UI/themes/MintAnnouncement.htm#mar9

 

Our problem began on March 13. Could there be something in that upgrade that is causing this?

 

Tim

 

 

Hello again, I implemented the code suggested by Aaron earlier and it works in the sandbox. I will implement this code in production after some testing and let you know how it goes.

 

I still think you have a problem related to your March 12 upgrade that will cause problems down the road in different situations where there is heavy transaction loads.

Hi Tim,

 

Have you updated your ticket with this information? I just want to make sure that we're tracking this in an organized fashion just in case there's a larger problem. Keeping everything up to date in the ticket will help us provide information to the various parts of the organization that are looking into this.

Is this fixed to create a customer profile using CreateCustomerProfile flag ???

Hello @yellushirisha

 

This issue has not been corrected but is on our backlog for a future release.

 

Richard

 

DE14232