Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 133 forks source link

Did not get response for Card Payment(CORS Policy Error) #613

Open Bratati14 opened 1 year ago

Bratati14 commented 1 year ago

Hello,

For 2 weeks I have been stuck on a request that does not work whenever i use Maestro Card and Credit Card for payment(using Sandbox) . Its shows some CORS policy error. I have send request but did not get any response so i simple print the error and i got this error message which is given below. Error message Access to XMLHttpRequest at 'https://api.sandbox.mangopay.com/Redirect/ACSWithValidation?token=1533b02f097c48ef879a3ec3bc236bb7&mgpsecureid=1533b02f097c48ef879a3ec3bc236bb7' (redirected from 'https://admin-test.next-commerce.io/buy-out-page-card') from origin 'https://admin-test.next-commerce.io/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

So I connect the MangoPay support team by mail to find help but they reply me to connect to the developer through Github and told me to post my concern here.

Looking forward to your return.

Thanks in advance.

fredericdelordm commented 1 year ago

Hello @Bratati14,

This issue is not with the PHP SDK right?

Bratati14 commented 1 year ago

Hello @fredericdelordm

Can you please let me know whats the exact issues if you say its not with the PHP SDK?

Because In your Documentation for Test Card Details Some Card payments are working(means return back me some response) and some are not working. Whats the exact issues and why some test card are working and some are not.

In our side the below cards are used for payment through sandbox

  1. CB/VISA/MC 4970107111111119 (with response Payment Fail) 4970105181818183 (with response errorCode=02625)
  2. Diners 30123456789001 (with response Success Message)
  3. Maestro/BCMC 5033951000000004 (did not give any response)- CORS Policy Errror

In our side we allow our server to get response without any restriction.

Looking forward to your return.

Thanks in advance.

fredericdelordm commented 1 year ago

Could you explain me your process to create the request and process a payment? I would like to understand which request are made from the backend (and the PHP SDK) and which are made from the frontend

Bratati14 commented 1 year ago

For Card payment first i registered the card and get card_registration_id,card_registration_url,PreregistrationData,AccessKey. Then send this details with card info to PayIn Create to make the payment. For Diners(30123456789001 (with response Success Message)) and CB/VISA/MC(4970107111111119 (with response Payment Fail),4970105181818183 (with response errorCode=02625)) I get response but for Maestro i get CORS Policy Errror. I used same function for all type of card payment but others are working except Maestro. Even I go through our sandbox login and see the Events. In event our card is registered and after that it failed. Here is the picture form Our sandbox account event. screenshot-dashboard sandbox mangopay com-2023 11 04-11_02_02