1

Is there any way to test apple pay in sandbox environment? Can we test with any dummy data or will it cut money from real card?

I have gone through two payment sdk one is Stripe and other is Braintree

Stripe providing sandbox environment as in this link.

I have a eCommerce store app in that I m using Apple Pay.

Please suggest.

Community
  • 1
  • 1
Niks
  • 647
  • 5
  • 16
  • Hii Niks. I have a doubt that is is it require to add test cards to our wallet in phone when testing apple pay with stripe in real device. i implemented apple pay with stripe. So is stripe provide sandbox default or we create sandbox for that? – vijju Mar 23 '18 at 10:16

2 Answers2

3

I did implement Pay in a shopping app using Braintree. You're probably aware that when you use Braintree, you got a Sandbox environment, and a Production environment. Apple Pay will match this behavior, you'll have to generate two MechantID, one for the Sandbox, and then one for Prod.

In Braintree, you'll link to the Sandbox MechantID in the Braintree Sandbox Dashboard, and to the Prod MerchantID in the Braintree Production Dashboard.

In your app, you'll need to have (at least) 2 builds configuration, one for Sandbox/Debug, one for Production/Release. You'll probably create a MechantID constant like that:

#if CONFIG_RELEASE
static NSString *const MerchantID = @"merchant.com.yourappname.braintree";
#else
static NSString *const MerchantID = @"merchant.com.example.braintree";
#endif

So then when you init the Apple Pay sheet, you just pass the MerchantID constant and it will grab the right one.

As well have having two entitlements files, on for each configuration pointing to the right Apple Pay Certificate. (The entitlements is generated when you toggle capabilities).

The Braintree documentation is really complete and helpful, please take a look.

I'm not sure how Stripe work, but I would bet the management of Sandbox/Prod basically works the same.

I hope this answer your question, I'd be happy to tell you more (if I can) about Apple Pay if you need so.

  • Thanks for the detailed answer, Is it compulsory to use 3rd party payment processor? I mean suppose I use Braintree Who will deduct money (Braintree?) and how owner will get that? Suppose I don't use ant 3rd party then? – Niks Jan 08 '16 at 06:27
2

You can develop your Apple pay sandbox environment, here is the explanation - https://developer.apple.com/library/ios/ApplePay_Guide/Configuration.html#//apple_ref/doc/uid/TP40014764-CH2-SW1

Kiran Jasvanee
  • 6,362
  • 1
  • 36
  • 52
  • Thanks Kiran for reply, as per above link I have to configure two environment one for live and one for sandbox? – Niks Jan 07 '16 at 14:24
  • Happy to help you, If you satisfied with my answer please up-vote it, it will help me to raise my contribution and rating. – Kiran Jasvanee Jan 07 '16 at 17:43