cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new Recurring Billing Transaction with same user

I'm currently trying to implement ARB. I have the regular work flow working for when a user decides to just do one subscription.
The workflow is:
   GetHostedPaymentPage to complete the initial transaction

   CreateCustomerProfileFromTransaction after the payment from the hosted page returns
   ARBCreateSubscriptionRequest from the newly created profile


Now this workflow works, but lets say the user decides to upgrade their subscription. How would this then work?

Once the GetHostedPaymentPge for the new subscription finishes, I'd need to check if that singe transactions is still the same one as the original payment profile or if its a new payment method

    - which API would I need to use to be able to do this? 

Case1: I find out that its a new payment. I would have to then create a new payment profile right? Then i'd have to either create a new sub and unsub the original. Or update the existing sub.
   - which APIs would I need for this?

case2: I found out that its an existing payment. Do i just update the existing sub? Would I need to get the paymentProfileId some how?

    - which APIs would I need for this?

Thanks

drewdrew
Member
1 REPLY 1

You can use the ARBUpdateSubscriptionRequest (https://developer.authorize.net/api/reference/index.html#recurring-billing-update-a-subscription) API for updating an existing subscription. This API can accept either payment information or the profile information like the ARBCreateSubscriptionRequest API to update a subscription. A sample ARBUpdateSubscriptionRequest with profile information is below:

 

<ARBUpdateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
	<merchantAuthentication>
		<name>**********</name>
		<transactionKey>*********</transactionKey>
	</merchantAuthentication>
	<refId>123456</refId>
	<subscriptionId>4745025</subscriptionId>
	<subscription>
        <profile>
          <customerProfileId>1812875413</customerProfileId>
          <customerPaymentProfileId>1809046411</customerPaymentProfileId>
        </profile>
	</subscription>
</ARBUpdateSubscriptionRequest>

 

When you pass payment information(credit card or bank account details) both ARBUpdateSubscriptionRequest and ARBCreateSubscriptionRequest creates payment profiles for you by default( Links the subscription to an existing payment profile incase it is already present).  

rahulr
Authorize.Net Developer Authorize.Net Developer
Authorize.Net Developer