我尝试使用以下示例参数实现 paypal 的Create Account API :
accountType=Premier&addressType.line1=Real+St&addressType.city=San+Jose&addressType.postalCode=92274&addressType.countryCode=US&addressType.state=California&citizenshipCountryCode=US&contactPhoneNumber=123-456-1234&homePhoneNumber=123-456-1234&mobilePhoneNumber=123-456-1234¤cyCode=USD&dateOfBirth=1970-01-01Z&emailAddress=test.test%40gmail.com&nameType.salutation=Miss&nameType.firstName=Malou&nameType.lastName=Perez&nameType.suffix=Sr&preferredLanguageCode=en_US®istrationType=Web&requestEnvelope.errorLanguage=en_US&requestEnvelope.detailLevel=ReturnAll&suppressWelcomeEmail=1&createAccountWebOptionsType.useMiniBrowser=0&createAccountWebOptionsType.returnUrl=http%3A%2F%2Fwww.testurlonly.com&createAccountWebOptionsType.reminderEmailFrequency=NONE&createAccountWebOptionsType.confirmEmail=0
为了更清楚,放入数组时的参数具有以下值:
$parameters = array(
'accountType' => 'Premier',
'addressType.line1' => 'Real St',
'addressType.city' => 'San Jose',
'addressType.postalCode' => '92274',
'addressType.countryCode' => 'US',
'addressType.state' => 'California',
'citizenshipCountryCode' => 'US',
'contactPhoneNumber' => '123-456-1234',
'homePhoneNumber' => '123-456-1234',
'mobilePhoneNumber' => '123-456-1234',
'currencyCode' => 'USD',
'dateOfBirth' => '1970-01-01Z',
'emailAddress' => 'test.test@gmail.com',
'nameType.salutation' => 'Miss',
'nameType.firstName' => 'Malou',
'nameType.lastName' => 'Perez',
'nameType.suffix' => 'Sr',
'preferredLanguageCode' => 'en_US',
'registrationType' => 'Web',
'requestEnvelope.errorLanguage' => 'en_US',
'requestEnvelope.detailLevel' => 'ReturnAll',
'suppressWelcomeEmail' => true,
'createAccountWebOptionsType.useMiniBrowser' => false,
'createAccountWebOptionsType.returnUrl' => 'http://www.testurlonly.com',
'createAccountWebOptionsType.reminderEmailFrequency' => 'NONE',
'createAccountWebOptionsType.confirmEmail' => false
);
这是AdaptiveAccounts/CreateAccount api 的响应(转换为数组):
array(18) {
["responseEnvelope.timestamp"]=>
string(29) "2013-01-07T21:33:01.984-08:00"
["responseEnvelope.ack"]=>
string(7) "Failure"
["responseEnvelope.correlationId"]=>
string(13) "ae7c9d245cabf"
["responseEnvelope.build"]=>
string(7) "4055066"
["error(0).errorId"]=>
string(6) "580029"
["error(0).domain"]=>
string(8) "PLATFORM"
["error(0).subdomain"]=>
string(11) "Application"
["error(0).severity"]=>
string(5) "Error"
["error(0).category"]=>
string(11) "Application"
["error(0).message"]=>
string(40) "Missing required request parameter: name"
["error(0).parameter(0)"]=>
string(4) "name"
["error(1).errorId"]=>
string(6) "580029"
["error(1).domain"]=>
string(8) "PLATFORM"
["error(1).subdomain"]=>
string(11) "Application"
["error(1).severity"]=>
string(5) "Error"
["error(1).category"]=>
string(11) "Application"
["error(1).message"]=>
string(43) "Missing required request parameter: address"
["error(1).parameter(0)"]=>
string(7) "address"
}
请告诉我为什么它说"Missing required request parameter: address"和"Missing required request parameter: name"。
我刚在想addressType.line1=Real+St&addressType.city=San+Jose&addressType.postalCode=92274&addressType.countryCode=US&addressType.state=California
指地址
和
nameType.salutation=Miss&nameType.firstName=Malou&nameType.lastName=Perez&nameType.suffix=Sr
指名称。
谢谢你。