简体   繁体   中英

processor_declined response for paypal braintree transaction

I have used non business account to create sandbox accounts. Transactions are created:-

$amount = $_POST["amount"];
$nonce = $_POST["payment_method_nonce"];
$result = $gateway->transaction()->sale([
    'amount' => $amount,
    'paymentMethodNonce' => $nonce,
    'options' => [
    'submitForSettlement' => true]
]);

The result which I got is :

Error processing transaction: code: 2081 text: PayPal pending payments are not supported

I am not sure is this issue occurred due to the account problem or the issue due to integration.

Making some research this is a currency issue coming from your sandbox account. I provide you with the answer and putting the source link to investigate further as this was an open ticket.

It looks like your sandbox account is setup to block payments from PayPal accounts with different currencies than the one you're making the request with.

If this is the behavior you want, you will need to create a test customer account with the same currency that you're using with the setup of Drop-in.

If this is not the behavior you want, you can log into sandbox.paypal.com and go to Profile > My Selling Tools > Block Payments to adjust the setting or Profile > My Money > PayPal Balance section > More > Currencies to add the currency of the account you are trying to use.

Source : Paypal sandbox issue

This solved for me:

1) Paypal: in paypal sandbox account I recreated a new Business Account indicating the Country where effectively run application (in my case: IT).

2) Paypal: With the business account just generated, I created new Paypal Application and I get paypal client ID and Secret.

3) Braintree: I re-linked my Paypal Sandbox application indicating credentuals of new Paypal business account: email, Client ID and Client Secret of the application just generated.

4) Into My Application/integration: in my braintree SDK js code (v3) I setted the right currency (in my case EUR) in the paypal setup js code:

<script>
var form = document.querySelector('#checkout-form');
var client_token = "{{ $clientToken }}";
var price = $('#selected_service_price').val();

braintree.dropin.create({
  authorization: client_token,
  selector: '#bt-dropin',
  paypal: {
    flow: 'checkout',
    amount: price, 
    currency: 'EUR'
  }
}, function (createErr, instance) {
  if (createErr) {
    console.log('Create Error', createErr);
    return;
  }
  form.addEventListener('submit', function (event) {
    event.preventDefault();
    instance.requestPaymentMethod(function (err, payload) {
      if (err) {
        console.log('Request Payment Method Error', err);
        return;
      }
      // Add the nonce to the form and submit
      document.querySelector('#nonce').value = payload.nonce;
      form.submit();
    });
  });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM