cancel
Showing results for 
Search instead for 
Did you mean: 

Integration of SIM with CIM and ARB

Hello

         I have developed my payment gateway using Auth.Net's SIM Method where im storing Information of transaction in my own table such as TransactionID,Invoice No etc.

         Now i want to add CIM and ARB functionalities also ... Following code i have written for achive ARB where ill pass InvoiceNumber which ill be getting after transaction from my table.What other information is required to Create ARB Subscription for given Transaction ...

 

        Also how should i write code for CIM to achive the task.

 

public void ARBCreateSubscription()
    {
        #region Create ARBCreateSubscription

        SubscriptionGateway subscriptionGateway = new SubscriptionGateway(apiLogin, transactionKey, ServiceMode.Test);

        myretaUI.NetAuthorizeApitest.Service ser = new myretaUI.NetAuthorizeApitest.Service();

        myretaUI.NetAuthorizeApitest.MerchantAuthenticationType mer = new myretaUI.NetAuthorizeApitest.MerchantAuthenticationType();
        mer.name = apiLogin;
        mer.transactionKey = transactionKey;

        myretaUI.NetAuthorizeApitest.ARBSubscriptionType arb = new myretaUI.NetAuthorizeApitest.ARBSubscriptionType();
        arb.amount = Decimal.Parse(this.subscriptionAmount.Text);
        arb.trialAmount = Decimal.Parse(this.trialAmount.Text);
        arb.trialAmountSpecified = true;
        arb.amountSpecified = true;
        arb.billTo = new myretaUI.NetAuthorizeApitest.NameAndAddressType();
        arb.billTo.address = "India";
        arb.billTo.firstName = "A";
        arb.billTo.lastName = "W";
        
        arb.customer = new myretaUI.NetAuthorizeApitest.CustomerType();
        myretaUI.NetAuthorizeApitest.PaymentScheduleType paymentScheduleType = new myretaUI.NetAuthorizeApitest.PaymentScheduleType();
        
        paymentScheduleType.startDate = DateTime.Parse(this.startDate.Text);
        paymentScheduleType.startDateSpecified = true;
        paymentScheduleType.totalOccurrences = short.Parse(this.totalOccurrences.Text); ;
        paymentScheduleType.totalOccurrencesSpecified = true;
        paymentScheduleType.trialOccurrences = short.Parse(this.trialOccurrences.Text); ;
        paymentScheduleType.trialOccurrencesSpecified = true;
        paymentScheduleType.interval = new myretaUI.NetAuthorizeApitest.PaymentScheduleTypeInterval();
        paymentScheduleType.interval.length = short.Parse(this.intervalLength.Text); ;
        arb.paymentSchedule = paymentScheduleType;

        arb.payment = new myretaUI.NetAuthorizeApitest.PaymentType();
        arb.order.invoiceNumber = "";
        arb.order.description = "";


        myretaUI.NetAuthorizeApitest.ARBCreateSubscriptionResponseType resp = ser.ARBCreateSubscription(mer, arb);
        if (resp.resultCode == myretaUI.NetAuthorizeApitest.MessageTypeEnum.Ok)
        {

        }

        //arbCreateSubscriptionRequest.subscription = sub;
        //var arbCreateSubscriptionResponse = (ARBCreateSubscriptionResponse)gateway.Send(req);

        #endregion
    }

 

 

Any Help on this will be highly appreciated

 

Thanks & Regards,

Anuprita.

anupritaw
Member
1 REPLY 1

Hi anupritaw,

 

You cannot create a CIM profile or ARB subscription from an existing transaction programmatically. The only way you can create a subscription from a successfully settled transaction is to do it manually by logging into the merchant interface but to create a CIM profile you need to use the CIM API or you can log in to the Authorize.Net to create the profile manually.

 

Some developers will also use AIM and ARB, AIM to process the first payment since ARB is not real time and verify the creditcard is valid and the information is correct like address (if you want to validate the billing information) and then ARB to handle all recurring payments.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator