1

私は、ユーザー A がさまざまな売り手から最大 10 個のアイテムを購入できるアプリに取り組んでいるため、同時にさまざまなユーザーに送金する必要があり、Paypal の連鎖支払いを使用しようとしています。

今、私はクラシック API (アダプティブ ペイメント) をいじっているだけですが、なぜいつもこのエラーが発生するのか不思議に思っています:

 "The fee payer PRIMARYRECEIVER can only be used if a primary receiver is specified"

すでにプライマリ レシーバーを指定しましたが、まだエラーが発生しています。

これらの例を見つけました: https://paypal-sdk-samples.herokuapp.com/adaptive_payments/pay 連鎖支払いを試みました:

これは私の支払い要求です:

require 'paypal-sdk-adaptivepayments'
@api = PayPal::SDK::AdaptivePayments::API.new

# Build request object
@pay = @api.build_pay({
  :actionType => "PAY",
  :cancelUrl => "https://paypal-sdk-samples.herokuapp.com/adaptive_payments/pay",
  :currencyCode => "USD",
  :feesPayer => "PRIMARYRECEIVER",
  :ipnNotificationUrl => "https://paypal-sdk-samples.herokuapp.com/adaptive_payments/ipn_notify",
  :receiverList => {
    :receiver => [{
      :amount => 1.0,
      :email => "platfo_1255612361_per@gmail.com",
      :primary => true }] },
  :returnUrl => "https://paypal-sdk-samples.herokuapp.com/adaptive_payments/pay",
  :sender => {
    :useCredentials => true } })

# Make API call & get response
@pay_response = @api.pay(@pay)

そして、これが応答です

{
  :responseEnvelope => {
    :timestamp => "2013-11-20T05:16:31-08:00",
    :ack => "Failure",
    :correlationId => "b002d0e27fd33",
    :build => "7935900" },
  :error => [{
    :errorId => 580023,
    :domain => "PLATFORM",
    :subdomain => "Application",
    :severity => "Error",
    :category => "Application",
    :message => "The fee payer PRIMARYRECEIVER can only be used if a primary receiver is specified",
    :parameter => [{
      :value => "feesPayer" },{
      :value => "PRIMARYRECEIVER" }] }] }

前もって感謝します!

4

1 に答える 1

3

taking a look at your call, you're indeed specifying a primary receiver. however, for chained payment, you will have to specify a secondary receiver.

I just ran a quick test with the following paramters:

actionType = PAY  
requestEnvelope.errorLanguage = en_US  
cancelUrl = http://abortURL  
returnUrl = http://returnURL  
ipnNotificationUrl = http://ipnURL  
applicationId = Test  
memo = Test   
currencyCode = USD  
receiverList.receiver(0).email = test@test.com  
receiverList.receiver(0).amount = 5.00  
receiverList.receiver(0).primary = true  
feesPayer = PRIMARYRECEIVER

and got the result:

responseEnvelope.timestamp=2013-11-20T05:41:56.751-08:00  
responseEnvelope.ack=Failure  
responseEnvelope.correlationId=b61a6b31ea2ab  
responseEnvelope.build=7935900  
error(0).errorId=580023  
error(0).domain=PLATFORM  
error(0).subdomain=Application  
error(0).severity=Error  
error(0).category=Application  
error(0).message=The fee payer PRIMARYRECEIVER can only be used if a primary receiver is specified  
error(0).parameter(0)=feesPayer  
error(0).parameter(1)=PRIMARYRECEIVER

However, once I change the FeesPayer to EACHRECEIVER, I get the error message that is causing the chained payment to fail in the first place:

responseEnvelope.timestamp=2013-11-20T05:48:09.202-08:00  
responseEnvelope.ack=Failure  
responseEnvelope.correlationId=987210ec4d03a  
responseEnvelope.build=7935900  
error(0).errorId=579008  
error(0).domain=PLATFORM  
error(0).subdomain=Application  
error(0).severity=Error  
error(0).category=Application  
error(0).message=You must specify only one primary receiver and at least one secondary receiver  
error(0).parameter(0)=1

I hope this helps.

Please refer to the PayPal Adaptive Payments SDK available under http://paypal.github.io/#adaptive-payments for some additional examples and inspiration

于 2013-11-20T13:56:05.273 に答える