I'm trying to add Mangopay to my react-native app.
When I try to add by HTTPie
a card, I get an error. Here is how I proceed:
I pre-register the card with:
echo '{
"UserId": "67844304",
"Currency": "EUR",
"CardType": "CB_VISA_MASTERCARD"
}' | http -a filoo:myApiKey POST https://api.sandbox.mangopay.com/v2.01/filoo/cardregistrations
It works and I can ask to add a new card with the informations I get:
echo '{
"PreregistrationData": "dtxlzFRSvUcdNkJimn-i_L64-_r7M5oECwslrv8Q04NgHVv1mxYX6qXicHf0SGAMS4wCy-yiraxeE65tmxOe8A",
"AccessKey": "1X0m87dmM2LiwFgxPLBJ",
"cardNumber": "4706750000000009",
"cardExpirationDate": "1221",
"cardCvx": "123"
}' | http -a filoo:myApiKey POST https://homologation-webpayment.payline.com/webpayment/getToken
But I get this very comprehensive error code inside the body of the response (with a 200 HTTP status code): errorCode=09101
I got the same issue and I resolved this problem by passing HTTP params as querystring.
Try to pass this way https://flaviocopes.com/axios-urlencoded/