cancel
Showing results for 
Search instead for 
Did you mean: 

Use same transactionId to perform another CIM transaction

I am using Authorize.net API to perform payment process.

I am able to perform successful payment and able to get transactionId of any user's transaction.

 

Merchant merchant = callMyMerchancy();

// Transaction process started.
Transaction transactions = merchant.createCIMTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
String customerProfileId = Class2.getCutomerId();
String paymentId = Class1.getPayamentId();
transactions.setCustomerProfileId(customerProfileId);
transactions.setCustomerPaymentProfileId(paymentId);

PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
Order order = Order.createOrder();
order.setTotalAmount(paymentAmount);
order.setDescription("Test payment");
paymentTransaction.setOrder(myOrder);
paymentTransaction.setTransactionType(net.authorize.TransactionType.AUTH_CAPTURE);
transaction.setPaymentTransaction(paymentTransaction);
Result<Transaction> response= (Result<Transaction>) merchant.postTransaction(transactions);

 



if (response.isOk()) {
System.out.println(" I got transaction id as : "
+ response.getDirectResponseList().get(0).getDirectResponseMap().get(ResponseField.TRANSACTION_ID));

 

 

In this way I am keeping track of transactionId for users.

Now I want to perform another transaction in future, for which transactionId will be same(transaction id which we have stored at
first time).

So anybody knows how to use same transactionId, and perform another transaction?

 

I am also processing ARB transaction process, where I am getting a new reference Id, in this case also I want to perform another ARB subscription with same referenceId.

 

	ServiceSoapProxy soapObject = new ServiceSoapProxy();

			
			try {
			
				soapObject.setEndpoint("https://apitest.authorize.net/soap/v1/Service.asmx");
				
				ANetApiResponseType a = soapObject.isAlive();

				ANetApiResponseType auth = soapObject
						.authenticateTest(merchantAuthentication);

				ARBCreateSubscriptionResponseType response = soapObject
						.ARBCreateSubscription(merchantAuthentication,
								subscription);
				logger.info("Subscription Id got as----"
						+ response.getSubscriptionId());
 
				} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

 


Does anybody can help me out how we can use same reference Id and perform ARB transaction ?


Thanks,

 

 

aryansds
Member
5 REPLIES 5

Do you mean a void or credit transaction? set the refID with the original transactionID.

 

Do you mean the subscription ID? they are unique to each subscription you created, so you can't use it again.

RaynorC1emen7
Expert

Thanks for quick reply. Yes I am using credit transaction.

 

 I have tried to set refId as a transactionId, and tried to performed transaction as below, transaction worked successful, 

 

but after that I just tried to get transactionId, but it's different.  Why is it so?

 

Am I doing any mistake over here.

 

I just want both transaction should have same transactionId.

 

 

Merchant merchant = callMyMerchancy();

// Transaction process started.
Transaction transactions = merchant.createCIMTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
String customerProfileId = Class2.getCutomerId();
String paymentId = Class1.getPayamentId();
transactions.setCustomerProfileId(customerProfileId);
transactions.setCustomerPaymentProfileId(paymentId);
transaction.setRefId("2203679642"); /******* set original transactionId as a refId*********/
PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
Order order = Order.createOrder();
order.setTotalAmount(paymentAmount);
order.setDescription("Test payment");
paymentTransaction.setOrder(myOrder);
paymentTransaction.setTransactionType(net.authorize.TransactionType.AUTH_CAPTURE);
transaction.setPaymentTransaction(paymentTransaction);
Result<Transaction> response= (Result<Transaction>) merchant.postTransaction(transactions);



Because you can have mutliple credit on a single auth_capture transaction. example, charge $50, credit 1 for $10, credit 2 for $15.

 

 

My scenario is :

 

CIM transaction:

 

1.First user will charged with normal CIM payament process, so we will get a transactionId which we will store in db.

2. User will charged for his group blog creation.(So here I want to set transactionId same as stored transactionId)

 

ARB Transaction:

3.ARB subscription will get created for user(subscription Id will get stored).

4.ARB subcription will get created for user's Group blog (subscription Id for this transaction will be same as above subscriptionId)

 

Is it possible to perform above scenario using authorize.net?

 

So in my case user can use same credit card info or can use new credit card , then also I want to perform second transaction with same 'TransactionId' of first one.

 

How can I do that? I tried your way , tried to set  first transactionId as a refId and performed transaction, but got new transactionId.

 

and also about ARB, is it really not possible to have 2 sbscriptions or a subscription with having sub-subscription with same subscriptionId?

 

Thanks,

 

 

 

You can NOT reuse a transactionID.

You can NOT reuse a subscriptionID.

 

Just create your own unique id on your own database. Or create an unique id and use the invoice# or purchase order# on the create transaction. same as ARB there is a invoice# field that you can use