Giter Site home page Giter Site logo

Comments (4)

jpablobr avatar jpablobr commented on June 3, 2024

Are you sure you have the accounts setup properly? like mentioned in the Paypal Sandbox & Accounts Setup section?

https://www.x.com/devzone/articles/iauction-adaptive-payments-tutorial-featuring-parallel-payments

from active_paypal_adaptive_payment.

hyperrjas avatar hyperrjas commented on June 3, 2024

Yeahh I have 2 seller account and 1 buyer account.

1 seller account for our app as merchant.
1 seller account for the service seller.
1 buyer account for the buyer.

I use the app_key for refund, this is my request:

 def refund
    .
    .
    gateway =  ADAPTIVEPAYMENT_GATEWAY
    pay_key = order.payment.pay_key # this **pay_key** is previously obtained on payment successfully.
    response = gateway.refund(:pay_key => pay_key, :requestEnvelope => {"errorLanguage" => "en_US"})
    logger.info response.inspect
    .
    .
    .
   end

This is response log:

  #<ActiveMerchant::Billing::AdaptivePaymentResponse:0x000000092c20c8 @json="{\"responseEnvelope\":{\"timestamp\":
 \"2012-09-21T09:37:48.402-07:00\",\"ack\":\"Success\",\"correlationId\":\"fb7ca06910768\",\"build\":\"3692562\"},\"currencyCode
 \":\"USD\",\"refundInfoList\":{\"refundInfo\":[{\"receiver\":{\"amount\":\"9.00\",\"email\":\"[email protected]\"},
 \"refundStatus\":\"NO_API_ACCESS_TO_RECEIVER\"},{\"receiver\":{\"amount\":\"1.00\",\"email\":
 \"[email protected]\"},\"refundStatus\":\"NO_API_ACCESS_TO_RECEIVER\"}]}}", 
@response=#<Hashie::Rash currency_code="USD" refund_info_list=#<Hashie::Rash refund_info=[#<Hashie::Rash
 receiver=#<Hashie::Rash amount="9.00" email="[email protected]">
 refund_status="NO_API_ACCESS_TO_RECEIVER">, #<Hashie::Rash receiver=#<Hashie::Rash amount="1.00" 
 email="[email protected]"> refund_status="NO_API_ACCESS_TO_RECEIVER">]> 
 response_envelope=#<Hashie::Rash ack="Success" build="3692562" correlation_id="fb7ca06910768" 
 timestamp="2012-09-21T09:37:48.402-07:00">>, @xml_request="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
 \n<RefundRequest>\n  <requestEnvelope>\n    <detailLevel>ReturnAll</detailLevel>\n    <errorLanguage>en_US</
 errorLanguage>\n  </requestEnvelope>\n  <actionType>REFUND</actionType>\n  <payKey>AP-2GU25810BV3339547</
 payKey>\n  <currencyCode>USD</currencyCode>\n  <feesPayer>EACHRECEIVER</feesPayer>\n</RefundRequest>\n", 
 @request={"RefundRequest"=>{"requestEnvelope"=>{"detailLevel"=>"ReturnAll", "errorLanguage"=>"en_US"}, 
 "actionType"=>"REFUND", "payKey"=>"AP-2GU25810BV3339547", "currencyCode"=>"USD",   
 "feesPayer"=>"EACHRECEIVER"}}, @action="Refund">

Thank you very much!

from active_paypal_adaptive_payment.

hyperrjas avatar hyperrjas commented on June 3, 2024

Ok the problem was, For a receiver to grant permission to refund to the API Caller:

Login to www.paypal.com (For Sandbox: www.sandbox.paypal.com - Make sure you are already signed in https://developer.paypal.com) and login with the receiver account. Goto Profile -> API Access -> Grant API Permission -> Input the API Caller (Example: May6_1307031077_biz_api1.paypal.com) in Third Party Permission Username textbos and click Lookup button -> Enable checkbox for "Issue a refund for a specific transaction" and click Add button.

This is how receiver can grant permission to API Caller.

Once this is enabled, the refund should work.

Founded in https://www.x.com/developers/paypal/forums/adaptive-payments-api/adaptive-refund-notprocessed

But then The refund feature depend from seller if have this feature enabled on his paypal account... This is a big problem because the merchant can not make a refund if the seller has this feature disabled...

For fix this problem you can Granting API Permissions via the API

You can see on https://www.x.com/devzone/articles/paypal-permissions-and-advantages-integrating-permissions-api

you can try it with gem https://github.com/moshbit/paypal_permissions

Thank you very much!

from active_paypal_adaptive_payment.

boboci9 avatar boboci9 commented on June 3, 2024

Hi,

I am having the same issue as you were having but I couldn't figure out how to get the refund to work with sandbox accounts. When I issue a general refund when I don't specify the sender the order get's refunded by both secondary receivers, but when I specify one of the original secondary receivers to issue the refund I get "'NO_API_ACCESS_TO_RECEIVER"
I tried using the Grant API Permissions form as you suggested but the issue is I don't know what username to enter as I am testing with accounts created by my sandbox developer paypal form and I only have email addresses there but the grant permissions for Lookup returns "Please enter valid API username."

Could you point me in the right direction? Thanks.

from active_paypal_adaptive_payment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.