0

我尝试使用以下示例参数实现 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&currencyCode=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&registrationType=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

名称

谢谢你。

4

1 回答 1

0

代替 nameType.,使用 name.. 因此,我们有

name.firstName, name.lastName, name.salutation and name.suffix

我删除了 name.salutation 因为我不知道该字段的正确值是什么。

对于addressType.,我将其替换为地址。此外,address.state 必须有州代码而不是州名。

我还发现 paypal 为格式和值不正确的字段返回580022 Invalid request parameter。我们不能放置不存在的邮政编码、城市和州的虚拟数据。

于 2013-01-08T07:16:58.713 回答