braintree / braintree-android-drop-in

Braintree Drop-In SDK for Android
https://developers.braintreepayments.com/guides/drop-in/android/v2
MIT License
124 stars 79 forks source link

"Return to merchant" Show this message. #53

Closed Jiks19 closed 6 years ago

Jiks19 commented 7 years ago

screenshot_2017-11-13-16-13-11-528_com android chrome

I have use braintree-android-drop-in. I try with my SendBox testing credentials

Not found any error or issue. How to resolve it?

Thanks,

sdcoffey commented 7 years ago

Hey @Jiks19,

Thanks for submitting this bug report. Can you be a little more specific about what precisely is wrong here?

Jiks19 commented 7 years ago

Hi sdcoffey,

Thanks for replay.

01

I have use yellow mark credential. 1) Click on Paypal button. 2) Enter login/password. 3) Click on login button.

than return "Return to merchant" screen.

4) Click on return to merchant button than return in my app. not find any error or other exception.

https://sandbox.braintreegateway.com/ Go to Settings > Processing > payment method > PayPal

1) Link Sendbox 2) Entered PayPal email, client id and client secret 3) Click on Link PayPal Sendbox.

I have share all the details. Let me inform me any more detail you need.

Thanks.

sdcoffey commented 7 years ago

He @Jiks19,

Thanks for the additional information. Unfortunately, we were not able to reproduce the issue using the steps you provided for us. Can you share with us the URLs that open in the browser when the switch starts? We can use that information to debug what might be happening in this particular case.

Jiks19 commented 7 years ago

Hi sdcoffey,

can you provide any testing credentials(email/password) for India country? So i can test here with your testing credentials.

Thanks,

Jiks19 commented 7 years ago

This URL open in browser

https://www.sandbox.paypal.com/agreements/approve?nolegacy=1&ba_token=BA-31N214971P224670Y&useraction=#/checkout/genericError?code=VU5TVVBQT1JURURfUEFZRUVfQ1VSUkVOQ1k%3D

ghost commented 7 years ago

I am facing same problem with woocommerce custom payment gatweway for paypal. Please let me know If you find any solution

sivapictuscode commented 7 years ago

I am also facing same problem with simple core php in both mode live and sandbox, How to fix any one give suggestion... Thanks in advance

Vaibs commented 7 years ago

I am facing the same issue. I followed a paypal php example , https://www.evoluted.net/thinktank/web-development/paypal-php-integration

I create 2 sandbox account, one business and the other buyer.

Now after setting up the application, while testing the buyers amount should be deducted with the sellers account should be credited. Whats happening is that weird page on the top with the button saying return to merchant.

Please help

ArjunDhar commented 7 years ago

I'm facing the same issue. And everything was working fine earlier. Same issue in Sandbox and production. This page is accompanied by a URL https://www.sandbox.paypal.com/checkoutnow?nolegacy=1&token=EC-459099459E9828727#/checkout/genericError?code=VU5TVVBQT1JURURfUEFZRUVfQ1VSUkVOQ1k%3D

also in the Merchant Account > Dev console @ https://developer.paypal.com/developer/dashboard/live/ ; there is no error.

So basically there is no error on the front end and no error in their backend. I feel BrainTree can imporve error handling to aid developers. Even if its a fault in the request the error handling here doesn't feel right. (Am using Java BrainTree API)

@sdcoffey Thanks for submitting this bug report. Can you be a little more specific about what precisely is wrong here? :

  1. ClientTokenRequest clientTokenRequest = new ClientTokenRequest().customerId(userIdForBrainTree);            
    ClientTokenGateway clientTokenGateway = getGatewayAdapter().clientToken(); //internal code
    String clientToken = clientTokenGateway.generate(clientTokenRequest);

    .. the above returns a clientToken successfully. Which is passed to the page. The Braintree javaScript API on page then uses that. (taken fom sample code and worked earlier perfectly fine)

  2. JavaScript Call using pagre params passed from server:

    var CLIENT_TOKEN_FROM_SERVER = $('#ct').val();
    var amt = Number(getParamValue('amt'));
    var currency = getParamValue('cur');
    var txnid = getParamValue('txnid');
    jQuery.debug(CLIENT_TOKEN_FROM_SERVER);
    var submitButton = document.querySelector('#submit');
    
    braintree.dropin.create({
    authorization: CLIENT_TOKEN_FROM_SERVER,
    selector: '#dropin-container',
    paymentOptionPriority: ['paypal', 'card'], // Display PayPal first
    paypal: {
      flow: 'checkout',
      amount: amt,
      currency: 'USD'
    }
    }, function (err, dropinInstance) { //callback
    $("#loading").hide();
     // Custom Ui Stuff  ....
    });
  3. Later when the PopUp appears the XHR setbuyer fails here:

    
    POST https://www.sandbox.paypal.com/webapps/hermes/api/batch/setbuyer
    HTTP Response: 400 Bad Request

Request Header >>>>> POST /webapps/hermes/api/batch/setbuyer HTTP/1.1 Host: www.sandbox.paypal.com Connection: keep-alive Content-Length: 1502 x-paypal-internal-euat: S23AAEEwxCaqQn2gFgHJUGUZMkgw5XhYZ7JVtrKVLWpedq_X1jBHqiS8YQVUZcZyxX_V2KdTnEuy9WxedWZ9sKUILonNA1xZw Origin: https://www.sandbox.paypal.com

There is a cookie also (not pasting that)

Response:

Response : {"ack":"success","data":{"securityCtx":{"ack":"success","data":{"logged_in":true,"guest":false,"remembered":false,"password_less":false,"auth_state":"LOGGEDIN","refresh_token":false,"access_token_present":true,"access_token":"S23AAEEwxCaqQn2gFgHJUGUZMkgw5XhYZ7JVtrKVLWpedq_X1jBHqiS8YQVUZcZyxX_V2KdTnEuy9WxedWZ9sKUILonNA1xZw","is_auth_api_call":true,"buyer_id":"BJC8KX28K37Z4","buyer_ipcountry":"US","idTokenPresent":true,"upsellOptInDisplayed":false,"ryiOptIn":{"termsDisplayed":false},"student_account":false,"ota":false,"remembered_device_token":false,"remembered_partner_assertion":false,"email":"","first_name":"test","last_name":"buyer","country":"IN","language":"en","account_type":0},"meta":{"calc":"c956f5963f7d6","rlog":"CZqQcd8WIWHkOcH8z4jim7GZqwKNCOMabYR1y2V%2F7KZpRK1L8%2FA66xNsQcNcLtb41dWYZICuWUlZ%2FBzvxsd6CQ_16002b4f2db"},"server":"wuXLj-buUUnEIYOUb9IkaMpU6_jC7RjtX5IaLQNA5KndCBc8i4lVJ3yWNgudEHSZICl1bXT9jE4neZhkvZ9oQSO8UVQ-DvwWxU18N-2kmga0LGfA9xY7Rb8newYmdzD-75mXh7Ps3qeyavf6eRpAntofs3yS4Zx3ZqexVbbadVrP1usyeRoqq4DwTA_jQo4SWZAo2kT7s4t8uLGSKHBHo8I2gjlTe-bdVfMLicwbUKAq0d9ukuTTFW"},"memberSegment":{"ack":"success","data":{"memberSegment":"SERVICE_ERROR"},"meta":{"calc":"c956f5963f7d6","rlog":"CZqQcd8WIWHkOcH8z4jim7GZqwKNCOMabYR1y2V%2F7KZpRK1L8%2FA66xNsQcNcLtb41dWYZICuWUlZ%2FBzvxsd6CQ_16002b4f2db"},"server":"FXFKpy8QfEWFcGu6vGAzogm7zr1VNuiWpEyElUu3asKJJaHFG-6Nt9IufQOFvRaQxlBayFTzGpZqr1r1BWQVkH-QJrSldAPQUmOMeok3FLIoZ-mx-7RZ_OoDMOQu1-Lo5DCkHoxXRW2qoQzYcDmlQBnrN4-_fUoh1RVbdWj__jbZb2DBcWnFFjVGBP-TnCgxQi3VcEaWnToSY8Ne2vH-5P0Gm0iLgpTZvPh8WZ9G3ykfr43zrQlgdfo1Gtvds8vewQ2ErN9e5-W"},"buyerEligibility":{"ack":"success","data":{"eligible":true,"clearedRT":false},"meta":{"calc":"c956f5963f7d6","rlog":"CZqQcd8WIWHkOcH8z4jim7GZqwKNCOMabYR1y2V%2F7KZpRK1L8%2FA66xNsQcNcLtb41dWYZICuWUlZ%2FBzvxsd6CQ_16002b4f2db"},"server":"R-iOPo-GGSKj9qQwB2daKVAQyIviL7QhqArd8f82zn9i0zluJe-rlHYfEtvttw7JMdjG8OKzeN4dHoxYdbyskiohif1biaKku5CdmB5XH2OHm29s04ciarSwb0utucSEGQP7Mgv-Zq19cBLgvchCGIbMPcFOFf9-YMe2K3D-7V2GWhBMH2GTXtYUSJ5Xl-LJlVXWq_vYhqIPqBpDocIwEyAzFP0RLwdtBvL7LrLvRaxqxw9vHp6Yf_c9D39XN8lmLgMi3sE6EIG"},"eConsent":{"ack":"success","data":{"required":false},"meta":{"calc":"c956f5963f7d6","rlog":"CZqQcd8WIWHkOcH8z4jim7GZqwKNCOMabYR1y2V%2F7KZpRK1L8%2FA66xNsQcNcLtb41dWYZICuWUlZ%2FBzvxsd6CQ_16002b4f2db"},"server":"l9ORAW4a10rFw1uOXqW2P83H9mghXDSADwVj_2bRCKUWqt5zzwv-0tKiGMBXs1fJvoKlqmA8t-EcwM0CokgpyfstQ0rB4oopnNqLeMhO9gHWL9_wg5T7Z9_iIS66gwV18qfRUUnjnV-kdnyAqWhkbrVOIyj2mwppcq4N2YoI1FMo51ZJLWkenPxbPNG1kbwisTrJ1oTscydKV4bAloPPw_vq2KacL7Gd0hr_3s_cMN4o18GBK5106cQTbSsC0fpG"},"createCheckoutSession":{"ack":"contingency","contingency":"UNSUPPORTED_PAYEE_CURRENCY","errorData":{"cause":"","step_up_context":{}},"meta":{"calc":"c956f5963f7d6","rlog":......."}



... Hope thats `precise` enough !
ArjunDhar commented 7 years ago

Hi an update to my post above. So in the response JSON, i took out some clues: "data":{"memberSegment":"SERVICE_ERROR"} .... "contingency":"UNSUPPORTED_PAYEE_CURRENCY" (in JSON Response) However, I have verified many times I am sending USD. So not sure why it insists UNSUPPORTED_PAYEE_CURRENCY

ArjunDhar commented 7 years ago

@sdcoffey and others : I jut looked @ the names of all the posters. Their names seem "Indian". Pay Pal recently launched in India and based on an error I managed to grab on, it said "Transactions between Indian residents must be made using Indian Rupees" . lol

So its assuming Calls made from India (perhaps based on IP) are intended for Indian Merchants. But Our PayPal is for US customers visiting the site. So I think there is a bug @ PayPal or atleast this is not properly handled.

Either you need to communicate to your merchants some regulatory requirement they are missing in their ADMIN or you have an out right bug in handling this properly.

I think this bug is very specific to India. Please followup or have someone followup.

Vaibs commented 7 years ago

This should not be the feature cause(as a seller) my buyers can reside anywhere in the world and using their own countries pp account . their might be something else.

Get Outlook for Androidhttps://aka.ms/ghei36


From: ArjunDhar notifications@github.com Sent: Wednesday, November 29, 2017 9:11:20 AM To: braintree/braintree-android-drop-in Cc: Vaibs; Comment Subject: Re: [braintree/braintree-android-drop-in] "Return to merchant" Show this message. (#53)

@sdcoffeyhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsdcoffey&data=02%7C01%7Cvaibs%40outlook.com%7C85507344e9484475534c08d536db0ec3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636475236833037907&sdata=8mB82SPtsd7shmySzEC07DqeZBiAf7idpI3AU5LpilA%3D&reserved=0 and others : I jut looked @ the names of all the posters. Their names seem "Indian". Pay Pal recently launched in India and based on an error I managed to grab on, it said "Transactions between Indian residents must be made using Indian Rupees" . lol

So its assuming Calls made from India (perhaps based on IP) are intended for Indian Merchants. But Our PayPal is for US customers visiting the site. So I think there is a bug @ PayPal or atleast this is not properly handled.

Either you need to communicate to your merchants some regulatory requirement they are missing in their ADMIN or you have an out right bug in handling this properly.

I think this bug is very specific to India. Please followup or have someone followup.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbraintree%2Fbraintree-android-drop-in%2Fissues%2F53%23issuecomment-347743536&data=02%7C01%7Cvaibs%40outlook.com%7C85507344e9484475534c08d536db0ec3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636475236833037907&sdata=jGmg3ae9821wBALNBfQduVJvG8fD2vL1djfmyQ7ucNQ%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACHJXK3o0p8XzUXvOZXSlEzTXEn4zeqKks5s7NJggaJpZM4Qbr68&data=02%7C01%7Cvaibs%40outlook.com%7C85507344e9484475534c08d536db0ec3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636475236833037907&sdata=JAjC%2BuC7daITgTNHOgJIGLc5GkkJkWpB3pHQb%2BhF0IM%3D&reserved=0.

ArjunDhar commented 7 years ago

Yes Exactly. Thats what im saying. They have some regulatory RULE in their that isnt smart enough or some regulatory requirement for the merchant is missing, Since they just officially launched in India its possible they have setup extra rules that are interfering in normal processing.

Based on all the data I have gathered while debugging:

  1. Its surely a Currency related issue -- UNSUPPORTED_PAYEE_CURRENCY
  2. It said Transactions between Indian residents must be made using Indian Rupees
  3. And all the guys on this thread are complaining seem to be from India + Paypal launched less than a month back and this thread is less than that old

...do the maths. The cause is obvious They need to fix it or tell us how to fix it.

abhilashpullelil commented 6 years ago

Is there any update on this issue? Can't Indian merchant's accept USD from Indian customers? If no then how can an Indian merchant accepting money from Indian customer in PayPal?

prateekkatyal commented 6 years ago

Same issue here.

I contacted their Merchant Support and they have confirmed that Indian currency transactions are not yet live. They said that it'll go live in February/March

Right now it seems I can't even accept USD payments from Indian residents?

Has anybody found a solution?

Vaibs commented 6 years ago

Share me your sample code, might be i cam help. I am not sure why it's working for me and even i went out through the same problem.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Prateek notifications@github.com Sent: Tuesday, January 9, 2018 2:08:23 PM To: braintree/braintree-android-drop-in Cc: Vaibs; Comment Subject: Re: [braintree/braintree-android-drop-in] "Return to merchant" Show this message. (#53)

Same issue here.

I contacted their Merchant Support and they have confirmed that Indian currency transactions are not yet live. They said that it'll go live in February/March

Right now it seems I can't even accept USD payments from Indian residents?

Has anybody found a solution?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbraintree%2Fbraintree-android-drop-in%2Fissues%2F53%23issuecomment-356216041&data=02%7C01%7C%7C7273f9bfb6fe46bdbb7608d5573c58d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636510839066731364&sdata=twoApyQz3JVala0pMkTDKYOUiBUHM78y4QJ9y%2FW8nF4%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACHJXOzBH0JdRsUoe5APKGkn33hbiz-Hks5tIyV-gaJpZM4Qbr68&data=02%7C01%7C%7C7273f9bfb6fe46bdbb7608d5573c58d5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636510839066731364&sdata=qsI7YpHu65GcT0rtlXrWffLpxhtCtybxW%2B3CRhqTfVQ%3D&reserved=0.

ghost commented 6 years ago

This is happening on my end as well

bluk commented 6 years ago

Hey all,

As a quick update, since it seems like many of you are experiencing the same issue: @prateekkatyal is correct in saying that this is an issue specifically with India-based PayPal merchant accounts. India-based PayPal merchant accounts should only use single payment checkout flows at this time. The Express Checkout with Braintree solution is the officially supported integration flow.

If you want to go live, please contact Merchant Technical Support to get integration assistance and to ensure your account meets all of the requirements.

ghost commented 6 years ago

I'm having same issues with github.com/logpacker/PayPal-Go-SDK,

c.CreateDirectPaypalPayment

Works and creates a redirect link.

After redirect link is opened it shows "Return to merchant" , sometimes shows "Unsupported payee currency" in production mode.

I wasted like 7 months to get this to work :(

Because I'm a solo developer I thought there must be some error on my end. So I ended up changing implementation of Paypal SDK more than 3 times in my golang project.

After trying hard enough, I got this to work by using a buy now button with IPN listener by using some hacks such as passing user ID in custom field etc.

I got ill and was ICU for few weeks to get this to work in less time.

I followed suggestions that were given in github.com/logpacker/PayPal-Go-SDK, It worked fine in dev mode but as soon as I switched to production mode it didn't work.

As a result I had implement one more payment option (Instamojo) which took more time to get the actual product ready.

I had no issues with Instamojo even though they do not provide a package for golang, they even provide option to specify webhook URL for payment notifications.

I feel so bad right now, I don't even know what suggestion to give to make this to work without any issues for Indian merchants.

bluk commented 6 years ago

@dineshbhosale I apologize for the difficulties you've had in your integration. I suggest contacting PayPal Merchant Technical Support as they have the best resources to ensure that any India-based merchant integration can be successful.