0

PayPal モジュールを osCommerce ベースのサイトに統合しようとしています - PayPal DoDirectPayment (SOAP) API を使用して PayPal を通じてクレジット カードの承認/支払いを実行するプラグインです。これまでのところ、私は持っています:

  • モジュールをインストールして動作させました
  • PaymentsPro が有効になっている PayPal サンドボックスでマーチャント アカウントを設定する
  • サンドボックスでクレジット カードを使用してバイヤー アカウントを作成した
  • サイトの請求先住所が、購入者アカウントの PayPal サンドボックスに保存されているクレジット カードの住所と一致することを確認しました。

チェックアウトプロセスを最後まで進めることができました。ただし、トランザクションが失敗するたびに、次のエラー メッセージが表示されます。

Invalid Data (10540)
無効なアドレスのため、トランザクションを処理できません。

ステップ デバッグ (XDEBUG 経由) を使用して、チェックアウト フォームで指定されたアドレス情報が cUrl 要求に渡されることを確認しました。送信される直前に表示される SOAP リクエストの下を見つけます。

潜在的に機密性の高い情報が変更されていることに注意してください。ただし、PayPal サンドボックスのアドレスと当サイトのアドレスを直接比較しました。これらは同一であり、ここにある API ドキュメントに記載されているフィールド仕様に準拠しています。42ページ以降

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">
      <Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
        <Username>login_api1.company.com</Username>
        <Password>xxxxxxxxxxxxxxxx</Password>
        <Subject></Subject>
      </Credentials>
    </RequesterCredentials>
  </soap:Header>
  <soap:Body>
    <DoDirectPaymentReq xmlns="urn:ebay:api:PayPalAPI">
      <DoDirectPaymentRequest>
        <Version xmlns="urn:ebay:apis:eBLBaseComponents">2.0</Version>
        <DoDirectPaymentRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">
          <PaymentAction>Sale</PaymentAction>
          <PaymentDetails>
            <OrderTotal currencyID="USD">13.96</OrderTotal>
            <OrderDescription>Order placed on March 21, 2013, 2:01 pm by   (ID: xx339)</OrderDescription>
            <ItemTotal currencyID="USD">8.45</ItemTotal>
            <ShippingTotal currencyID="USD">4.51</ShippingTotal>
            <HandlingTotal currencyID="USD"></HandlingTotal>
            <TaxTotal currencyID="USD">1</TaxTotal>
            <Custom>Phone: xxx-xxx-xxxx -- Email: xxxxxxxxxx@gmail.com</Custom>
            <InvoiceID></InvoiceID>
            <NotifyURL></NotifyURL>
            <ButtonSource></ButtonSource>
            <ShipToAddress>
              <Name></Name>
              <Street1>1313 Park Forest</Street1>
              <Street2></Street2>
              <CityName>Batavia</CityName> 
              <StateOrProvince>OH</StateOrProvince>
              <PostalCode>45103</PostalCode>
              <Country>US</Country>
            </ShipToAddress>
            <PaymentDetailsItem>
                <Name>Custom Poker Deck</Name>
                <Amount currencyID="USD">5.67</Amount>
                <Number>-</Number>
                <Quantity>1</Quantity>
            </PaymentDetailsItem>
            <PaymentDetailsItem>
                <Name>BRAWL Deck</Name>
                <Amount currencyID="USD">3.78</Amount>
                <Number>-</Number>
                <Quantity>1</Quantity>
            </PaymentDetailsItem>
            <PaymentDetailsItem>
                <Name>Order Total Discrepancy</Name>
                <Amount currencyID="USD">-1.00</Amount>
                <Number>-</Number>
                <Quantity>1</Quantity>
            </PaymentDetailsItem>
          </PaymentDetails>
          <CreditCard>
            <CardOwner>
              <Payer>xxxxxxxxxx@gmail.com</Payer>
              <PayerName>
              <FirstName>John</FirstName>
              <LastName>Doe</LastName>
              </PayerName>
              <Address>
                <Street1>1313 Park Forest</Street1>
                <Street2></Street2>
                <CityName>Batavia</CityName> 
                <StateOrProvince>OH</StateOrProvince>
                <PostalCode>45103</PostalCode>
                <Country>US</Country>
              </Address>
            </CardOwner>
            <CreditCardType>Visa</CreditCardType>
            <CreditCardNumber>4711505238313977</CreditCardNumber>            
            <ExpMonth>03</ExpMonth>
            <ExpYear>2018</ExpYear>
            <CVV2>000</CVV2>            
          </CreditCard>
          <IPAddress>127.0.0.1</IPAddress>
          <MerchantSessionId>iou1mhmkuo1lnmd8e0vvpfbmp5</MerchantSessionId>
        </DoDirectPaymentRequestDetails>
      </DoDirectPaymentRequest>
    </DoDirectPaymentReq>
  </soap:Body>
</soap:Envelope>

ターゲットのサンドボックス API エンドポイントから返された応答(https://api.sandbox.paypal.com/2.0は次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
        <SOAP-ENV:Header>
            <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security>
            <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
            <Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
                <Username xsi:type="xs:string"></Username>
                <Password xsi:type="xs:string"></Password>
                <Signature xsi:type="xs:string"></Signature>
                <Subject xsi:type="xs:string"></Subject>
            </Credentials>
            </RequesterCredentials>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body id="_0">
        <DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI">
            <Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2013-03-22T20:24:12Z</Timestamp>
            <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
            <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">94b4190427bbe</CorrelationID>
            <Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
                <ShortMessage xsi:type="xs:string">Invalid Data</ShortMessage>
                <LongMessage xsi:type="xs:string">The transaction cannot be processed due to an invalid address.</LongMessage>
                <ErrorCode xsi:type="xs:token">10540</ErrorCode>
                <SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
            </Errors>
            <Version xmlns="urn:ebay:apis:eBLBaseComponents">2.0</Version>
            <Build xmlns="urn:ebay:apis:eBLBaseComponents">5479129</Build>
            <Amount xsi:type="cc:BasicAmountType" currencyID="USD">13.96</Amount>
        </DoDirectPaymentResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

この問題 ( PayPal モジュールを使用してトランザクションを処理できません) は、待機することで解決できる SandBox の問題であることを示唆しています。

また、(サンドボックスでのペイパルの直接支払いエラー)および(ペイパル ウェブサイト ペイメント プロの DoDirect ペイメント インテグレーションの問題。マーチャントの設定が無効なため、このトランザクションを処理できません)も精査しましたが、有用なものは見つかりませんでした。

どんな助けでも大歓迎です。

4

1 に答える 1

1

発送先住所フィールドに名前を渡していないため、リクエストはエラーになります。ここに名前を挿入する必要があります。そうすれば、リクエストが機能するはずです。いくつかのテストを実行しましたが、名前が挿入されると、テストはうまくいきます。また、バージョン 98.0 を使用していましたが、これは最新バージョンである必要があります。現在、2.0に設定しています。

<ShipToAddress>
<Name></Name>
<Street1>1313 Park Forest</Street1>
<Street2></Street2>
<CityName>Batavia</CityName> 
<StateOrProvince>OH</StateOrProvince>
<PostalCode>45103</PostalCode>
<Country>US</Country>
</ShipToAddress>
于 2013-03-25T13:35:37.153 に答える