Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply pay - usageError #106

Closed
tonydiaz opened this issue May 8, 2020 · 4 comments
Closed

Apply pay - usageError #106

tonydiaz opened this issue May 8, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@tonydiaz
Copy link

tonydiaz commented May 8, 2020

Describe the issue

I was working to integrate Apply pay. It loads just fine but when I try to process the payment it fails.

I generated a CSR using the sandbox Apple Pay and loaded it correctly to the Apple developer program Merchant ID. I confirmed I'm using my sandbox application ID. All other transactions go through for me (credit cards and Google pay) to the sandbox. Just not working for apply pay.

Based on a comment in the sellercomunity I also generated a CSR in production but I still see the same error:
https://www.sellercommunity.com/t5/Developer-Discussions/Flutter-Apple-pay-error-production-simulator/m-p/169106#M1750

Here is the error:

ErrorInfo {
  code=usageError,
  message=Something went wrong. Please contact the developer of this application and  provide them with this error code: production_simulator,
  debugCode=apple_pay_nonce_request_production_simulator,
  debugMessage=Apple Pay cannot be used in the simulator with a production Square application ID. Please use a Square sandbox application ID or test Apple Pay on a physical device.,

To Reproduce

  1. Initialize the SDK
  2. Initialize Apple Pay
  3. call `await InAppPayments.requestApplePayNonce(..)
    Here the piece of code that reproduce the issue.
await InAppPayments.setSquareApplicationId(SANDBOX_APPLICATION_ID);

await InAppPayments.initializeApplePay(MERCHANT_ID);

await InAppPayments.requestApplePayNonce(
   price: '1.00',
   summaryLabel: 'Cookie',
   countryCode: 'US',
   currencyCode: 'USD',
   paymentType: ApplePayPaymentType.finalPayment,
   onApplePayNonceRequestSuccess: _onApplePayNonceRequestSuccess,
   onApplePayNonceRequestFailure: _onApplePayNonceRequestFailure,
   onApplePayComplete: _onApplePayEntryComplete);

Expected behavior

I expected the transaction to be processed on the sandbox.

Environment (please complete the following information):

Screenshots

applePay

Additional context

@tonydiaz tonydiaz added the bug Something isn't working label May 8, 2020
@StephenJosey
Copy link
Contributor

Is that a test card (I see "simulated card")? Per our docs:

Apple does not allow Sandbox Test credit card values . You must use a valid credit card from your Apple Pay Wallet. The card is not charged for test payments as long as you are testing in the Sandbox.

Please make sure you're testing with a valid credit card. If you are, please let me know and we can look into it further.

@tonydiaz
Copy link
Author

tonydiaz commented May 9, 2020

That sounds right.

I'm having trouble adding a valid credit card to the Wallet app. Apple docs say to create a sandbox test account (which I have) but I can't figure out where to log the account in on the iPhone emulator. https://developer.apple.com/apple-pay/sandbox-testing/

Under Settings-> Sign in to you iPhone
Screen Shot 2020-05-09 at 2 03 23 PM

I just keep getting errors about the (sandbox test account) username or password is incorrect. I have tried a few sandbox test accounts
Screen Shot 2020-05-09 at 2 04 58 PM

Even though I successfully login with them on the Apple ID site: https://appleid.apple.com/]

Not sure if anyone has seen this before?

@tonydiaz
Copy link
Author

I figured out after creating a sandbox test account. That account needs to login to icloud.com to accept the terms before being able to login on the iPhone simulator. Still unable to login to iTunes and App store.

After some more searching, it looks like you can't enter a valid credit card on the iPhone simulator for security reasons. It must be a real device.

@StephenJosey
Copy link
Contributor

Ah, of course, great find. Thanks for sharing it here! I'll go ahead and close this issue, but of course let us know if you have additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants