cancel
Showing results for 
Search instead for 
Did you mean: 

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?

deevoo
Member
1 ACCEPTED SOLUTION

Accepted Solutions

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

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert
2 REPLIES 2

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 !

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

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.