Reply
Member
Posts: 6
Registered: ‎02-20-2013
Accepted Solution

Charge card, create profile, create subscription PHP

I've been trying to move our charges over to the API in php.

I have charge a card and create profile working but cannot get create a subscription to work.

I am trying to do this all on the same page.

I am trying to grab the profile ID, payment ID, and address ID for the subscription.

When i put the function in for ARB I get errors on the "use net\authorize\api\contract\v1 as AnetAPI;" - most likely since it was used previously. So I commented those two lines out and nothing happened. Not even an error.

Is it even possible to do these all on one page?

After the charge and create profile, I use these:

$transid=$tresponse->getTransId();
$profileID=$presponse->getCustomerProfileId;
$paymentID=$presponse->getCustomerPaymentProfileIdList[0];
$addressID=$presponse->getCustomerShippingAddressIdList[0];

 Is this incorrect? I could not find anything about doing it this way.

Any other suggestions if I can't?


Accepted Solutions
Highlighted
Solution
Accepted by topic author deevoo
‎06-20-2018 07:35 AM
Authorize.Net Expert
Posts: 44
Registered: ‎07-27-2016

Re: Charge card, create profile, create subscription PHP

Hi @deevoo

 

  • getCustomerProfileId
  • getCustomerPaymentProfileIdList
  • getCustomerShippingAddressIdList

are functions,

hence you need to call as functions like this,

 

$profileID=$presponse->getCustomerProfileId();
$paymentID=$presponse->getCustomerPaymentProfileIdList()[0];
$addressID=$presponse->getCustomerShippingAddressIdList()[0];

 

 

Hope this helps !

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author deevoo
‎06-20-2018 07:35 AM
Authorize.Net Expert
Posts: 44
Registered: ‎07-27-2016

Re: Charge card, create profile, create subscription PHP

Hi @deevoo

 

  • getCustomerProfileId
  • getCustomerPaymentProfileIdList
  • getCustomerShippingAddressIdList

are functions,

hence you need to call as functions like this,

 

$profileID=$presponse->getCustomerProfileId();
$paymentID=$presponse->getCustomerPaymentProfileIdList()[0];
$addressID=$presponse->getCustomerShippingAddressIdList()[0];

 

 

Hope this helps !

Member
Posts: 6
Registered: ‎02-20-2013

Re: Charge card, create profile, create subscription PHP

This helped as far as getting the variables so I can store them but I ended up having to make another page to make the subscription after. I just couldn't get it to work with both processes on the same page for some reason.