cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

getPaymentProfileId() vs getCustomerPaymentProfileIds()

What is the difference between getPaymentProfileId() and getCustomerPaymentProfileIds()? When should I use which?

 

I teste using this code:

 

$rsp = $req->createCustomerPaymentProfile($customer_id, $payment, 'testMode');

$payment_id = $rsp->getPaymentProfileId();

 

but sometimes $payment_id is "" (i.e. empty string).  I also tested on production server with 'liveMode', and the result is the same.

 

Should I use getCustomerPaymentProfileIds() even if I only add one payment profile?  The name suggest that the function would return an array of paymentIds, but when I tried it only returned one scalar value.

 

Since I can't find any document on either function, can someone please explain when to use which?

jobs2careers
Member
3 REPLIES 3

I think is depend on how many payment profile id that customer profile id have.

RaynorC1emen7
Expert

That's what I thought to, but unfortunately that's not the case.

I only created one customer payment profile, so I thought I should use getPaymentProfileId(), but it's returning empty string.

Look to me for createCustomerPaymentProfile, use getPaymentProfileId because there is only one allow for each call.

And getCustomerPaymentProfileIds for createCustomerProfile because you can do multiple payment profiles.