cancel
Showing results for 
Search instead for 
Did you mean: 

[Sandbox] Refunding a sale I just made with the REST API does not work

SOLVED
Highlighted
Member

[Sandbox] Refunding a sale I just made with the REST API does not work

I don't know where to ask this question, the developer support has no way to ask my own question.

 

I need to allow users to pay for a service on my site and cancel (refund) the payment if a process that is performed afterwards does not work.

 

I get the payment from the API then try to refund the sale, but the sandbox API tells me:

{"name":"TRANSACTION_REFUSED","message":"Request was refused.You can not refund this type of transaction","information_link":"https://developer.paypal.com/docs/api/payments/#erro
rs","debug_id":"63ac57114e53f"}

The sale object is:

 

{
  "sale": {
    "id": "8M110500E9777092N",
    "amount": {
      "currency": "EUR",
      "total": "30.19",
      "details": {
        "subtotal": "25.16",
        "tax": "5.03"
      }
    },
    "payment_mode": "INSTANT_TRANSFER",
    "state": "pending",
    "reason_code": "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION",
    "protection_eligibility": "ELIGIBLE",
    "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
    "parent_payment": "PAY-5D307865BK154252TLGOU77Q",
    "create_time": "2017-08-23T09:52:09Z",
    "update_time": "2017-08-23T09:52:09Z",
    "links": [
      {
        "href": "https://api.sandbox.paypal.com/v1/payments/sale/8M110500E9777092N",
        "rel": "self",
        "method": "GET"
      },
      {
        "href": "https://api.sandbox.paypal.com/v1/payments/sale/8M110500E9777092N/refund",
        "rel": "refund",
        "method": "POST"
      },
      {
        "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5D307865BK154252TLGOU77Q",
        "rel": "parent_payment",
        "method": "GET"
      }
    ]
  }
}

Note the "pending" state with reason:

RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION

In the sandbox dashboard, the facilitator has the following settings:

Sandbox facilitator  settingsSandbox facilitator settings

This is the API calls history. Note the "!" in orange. I have access to no additional information about the "!" sign in the middle.

 

API calls.API calls.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: [Sandbox] Refunding a sale I just made with the REST API does not work

Hi @judu

You cannot refund this payment, as it was sent in EUR, but the receiving account only has a balance in USD and therefore the payment is currently in an "unclaimed" status. You can login to the receiving account and either accept the payment and open a EUR balance or just open a EUR balance and all payments which are currently "unclaimed" will be accepted into the account balance.

Once they payment has a status of "completed", then you will be able to refund the transaction. You only need to open the EUR balance once, all future transactions sent in EUR will be automatically accepted.

Was my post helpful? If so, please give me a kudos!
1 REPLY
Moderator

Re: [Sandbox] Refunding a sale I just made with the REST API does not work

Hi @judu

You cannot refund this payment, as it was sent in EUR, but the receiving account only has a balance in USD and therefore the payment is currently in an "unclaimed" status. You can login to the receiving account and either accept the payment and open a EUR balance or just open a EUR balance and all payments which are currently "unclaimed" will be accepted into the account balance.

Once they payment has a status of "completed", then you will be able to refund the transaction. You only need to open the EUR balance once, all future transactions sent in EUR will be automatically accepted.

Was my post helpful? If so, please give me a kudos!