network-international / react-native-ngenius

Other
5 stars 8 forks source link

Apple pay is not working #8

Closed ramisalem closed 1 year ago

ramisalem commented 3 years ago

Hello, I checked the code of this package and I find out that the initiateApplePay method has two parameters first is applePayConfig which is an object, and the second is the order, where it has been written wrong in the docs

After I edited the code I am getting

const applePayConfig = {
      merchantIdentifier: '*****',
      countryCode: 'UAE',
      totalAmount: total,
      currencyCode: 'AED',
      merchantName: '*****',
    };
    try {
      const resp = await initiateApplePay(o, applePayConfig);
    } catch (err) {
      console.log({ err });
    } 

result "err": {"error": undefined, "status": "Failed"}}  

Could you please tell me what did I miss?

mu1ex commented 2 years ago

Thank you, we have updated the readme. Also have you enabled apple pay in the merchant portal?

kareem-ali-abdelsalam commented 2 years ago

Hello @mu1ex, I got same error with Apple Pay {"error": undefined, "status": "Failed"}

kareem-ali-abdelsalam commented 2 years ago

Hi @mu1ex How can we fix it please ?

mu1ex commented 2 years ago

Hi @ramisalem @kareem-ali-abdelsalam please update to version 1.1.1 and the errors should be fixed.

kareem-ali-abdelsalam commented 2 years ago

@mu1ex We have this version 1.1.1 already, did you try it ?

mu1ex commented 2 years ago

Yes @kareem-ali-abdelsalam, it works. If the payment is declined, it's got to do with the certificate mismatch. I would recommend you to create a new MID in Apple's dev portal, configure the same in NGenius Portal, by downloading and uploading the CSR and signed certificates respectively against the new MID.

kareem-ali-abdelsalam commented 2 years ago

Thank you @mu1ex, How can i configure it on NGenius Portal ?

iKambad3618 commented 2 years ago

@mu1ex I installed "@network-international/react-native-ngenius": "^1.1.3", iOS Supported version is 11.0 also all setup done in NGenius Portal, but still getting {"error": undefined, "status": "Failed"}

it's got to do with the certificate mismatch. My certificate is also valid and also created new once and uploaded on NGenius Portal

Also apple pay sheet is opening but then after getting error

mu1ex commented 1 year ago

@iKambad3618 , the certificate mismatch will require you to change the Apple MID and reconfigure the certs on the App and NGenius portal.