Reply
Highlighted
Regular Contributor
Posts: 50
Registered: ‎05-31-2016
Accepted Solution

How to set createProfile using PHP API

Most of my questions have been answered but I can't seem to get this to work.

I can run a successful transaction and add customer billing info, but I can't get it to create a profile for me.

 

In a previous post I was told to set createProfile=true. I am trying to do that like so:

$this->custpaymentprofile = new AnetAPI\CustomerProfilePaymentType();
$this->custpaymentprofile->setCreateProfile(true);

 

How do I send custpaymentprofile to the transaction?

Example: $this->transactionRequestType->setBillTo($this->billto);

 How do I send the createProfile info?

 

Thanks,

 

- D


Accepted Solutions
Highlighted
Solution
Accepted by topic author fifty-git
‎06-15-2016 01:09 PM
Moderator
Posts: 590
Registered: ‎08-21-2009

Re: How to set createProfile using PHP API

I'm not sure in your code sample here exactly what $this is referring to. In our sample code, we generally have a transactionRequestType object that is simply named $transactionRequestType. In order to add the flag to create a profile to one of our samples, you would need to add this code:

 

$profile = new AnetAPI\CustomerProfilePaymentType();
$profile->setCreateProfile(true); 
$transactionRequestType->setProfile($profile);

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author fifty-git
‎06-15-2016 01:09 PM
Moderator
Posts: 590
Registered: ‎08-21-2009

Re: How to set createProfile using PHP API

I'm not sure in your code sample here exactly what $this is referring to. In our sample code, we generally have a transactionRequestType object that is simply named $transactionRequestType. In order to add the flag to create a profile to one of our samples, you would need to add this code:

 

$profile = new AnetAPI\CustomerProfilePaymentType();
$profile->setCreateProfile(true); 
$transactionRequestType->setProfile($profile);
Highlighted
Regular Contributor
Posts: 50
Registered: ‎05-31-2016

Re: How to set createProfile using PHP API

Thanks, this is what I was looking for:

$transactionRequestType->setProfile($profile)

 

Thanks,

 

- D

Highlighted
Member
Posts: 1
Registered: ‎07-01-2019

Re: How to set createProfile using PHP API

Hi, I've an implementation for PHP, for some reason when trying to instantiate a new class of CustomerProfilePaymentType it's throwing a class not found exception, can you please give me some advice? I've checked and everything seems to be fine there: sdk-php/lib/net/authorize/api/contract/v1/