[ PHP - PayPal Adaptive Payment - InstitutionCustomer ]
I am currently working with PayPal Adaptive Payments API, using Angel Eyes Library
I am using the PayWithOptions.php (Also referred to as just: Pay)
What it does is, that it sends out a payment from my PayPal account to a customers PayPal account on a click of a button.
I am encountering a problem:
Invalid request parameter: institutionId with value 5
The full error:
[Ack] => Failure
[Build] => 9898581
[CorrelationID] => 2aa511de53ce9
[Timestamp] => 2014-03-05T02:59:16.748-08:00
[PayKey] => AP-63569347PY5071349
[PaymentExecStatus] => CREATED
[RedirectURL] => https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=AP-63569347PY5071349
[PayXMLRequest] => ReturnAllen_USCREATEhttp://wattbux.com/a/APP-80W284485P519543T173.245.53.242USDEACHRECEIVERECHECKBALANCECREDITCARD9test@test.comSERVICEhttp://wattbux.com/a/
[PayXMLResponse] => 2014-03-05T02:59:16.748-08:00Success2aa511de53ce99898581AP-63569347PY5071349CREATED
[SetPaymentOptionsXMLRequest] => ReturnAllen_USAP-63569347PY507134951122USERNAME1DKAngellEYE_PHPClass
[SetPaymentOptionsXMLResponse] => 2014-03-05T02:59:17.054-08:00Failure2bc204d053e2f9898581580022PLATFORMApplicationErrorApplicationInvalid request parameter: institutionId with value 5institutionId5
This is the PHP code:
$InstitutionCustomer = array(
'CountryCode' => 'DK', // Required. 2 char code of the home country of the end user.
'DisplayName' => 'USERNAME', // Required. The full name of the consumer as known by the institution. 200 char max.
'InstitutionCustomerEmail' => 'PAYPAL@TEST.COM', // The email address of the consumer. 127 char max.
'FirstName' => '11', // Required. The first name of the consumer. 64 char max.
'LastName' => '22', // Required. The last name of the consumer. 64 char max.
'InstitutionCustomerID' => '1', // Required. The unique ID assigned to the consumer by the institution. 64 char max.
'InstitutionID' => '5' // Required. The unique ID assiend to the institution. 64 char max.
);
I have no idea what "IstitutionXXX" is - can someone shed some light on this?
Answer 1
This is a little bit misleading in my class, I know. Those are labeled required, but they're only required IF you actually include the institution information to begin with. If you leave all of that out entirely then none of those fields are required.
I've never once had the need to use those parameters, so I can't tell you 100% for sure what they're used for either, however, I can tell you to just leave them out of the request (and remove them from $PayPalRequestData) and that problem will go away.
The same goes for some of those other parameters. I generally like to start with the fewest parameters necessary to get things working and then add things from there as you want/need.
Again, I know those required labels are confusing, but try to think of those as required per array.