How to add payment card programmatically into apple wallet - ios

We tried to add credit, debit card details into Apple Pay from within our app.
The below are the things from apple doc.
Important Adding payment passes requires a special entitlement issued by Apple. Your app must include this entitlement before this class can be instantiated. For more information on requesting this entitlement, see the Card Issuers section at developer.apple.com/apple-pay/.
In sandbox environment we tried entitlement key , but we can't load payment card details.
We can add payment card iTunes manually. But can possible to add payment card in apple pay wallet programmatically.
Is't possible to mock the Testcard (payment card) like pkpass file?
No documentation available to mock the payment card in sandbox environment.
https://developer.apple.com/reference/passkit/pkaddpaymentpassviewcontroller?language=objc
Thanks in advance.

If I understand you correctly, you have the entitlement key in place (and I assume you have acquired the special permission from Apple). I am also assuming that you are using the PKAddPaymentPassViewController for the provisioning process. If all of this is correct then there are a few more things you need to keep in mind. First of all, you cannot test this using mock data or even test environments. You must use production data with real payment cards which can be confirmed by Apple Pay with the card issuer. Also, the app must be distributed with TestFlight in order for it to work, so you cannot run from Xcode directly.

Enabling In-App Provisioning of Payment Cards
Use this entitlement to enable the in-app provisioning of payment
cards. This entitlement allows you to initialize and present a PKAddPaymentPassViewController object.
In the entitlement’s file, add the com.apple.developer.payment-pass-provisioning key with a Boolean value of YES. You need special permission from Apple to submit apps with this key enabled. For more information, contact apple-pay-inquiries#apple.com.
https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/ApplePayandPassKitEntitlements/ApplePayandPassKitEntitlements.html

Related

Test iOS auto-renewable subscription feature by adding credit card / paypal

Actually I have implemented auto-renewable subscription feature using In-App Purchase on my project.
It throws payment cancelled when I try adding card whilst subscribing. If card is already added, it is working fine.
But App store shows subscription and payment done.
I have used SwiftyStoreKit library which is no longer maintained from May 1.
I have tested all in production mode by downloading app from app store.
Is there any way to test it while development? In sandbox mode, there is no option to test by adding card or paypal.
No,
there is no option to test it while in development. It might be possible to simulate the exact same scenario, but with "parental permissions" - create IAP product that requires parental permissions, and make sure your account is "child" or "limited" - it should have similar flow like expired credit card. Although I have not tested it, but worth a shot.
what happens is that if you add new transaction to the transaction queue, and credit card has expired, you will get "transaction failed" in your queue. If user then fills out the correct credit card, you will get "transaction succeeded" message.
https://forums.developer.apple.com/thread/6431
here you can read more about credit card expiration.

Is the code signature crucial to prove ownership?

I am developing an iOS game (closed source), but working in partnership with publisher company. The ownership should be mine and then I should authorize the publisher to just distribute the game in some countries/regions via legal agreement. However I need to sign the code with p12 cert and a provisioning profile... The publisher sent me their certificates, but is it safe to use them since I should remain the owner of the game?
To be on the safer side I would suggest you to add the publisher's apple Id to your team(in your apple Id). You can then assign particular roles to the publisher and restrict the actions which can be performed. You car get more detailed information from below sources :
https://developer.apple.com/support/roles/
https://sandeshsardar.com/2017/04/01/how-to-manage-your-developer-account-team/
Hope this helps you in some way.

How to add a credit/debit card into apple wallet from the ios App

I would be really helpful if anyone provides a solution to know, how do we add the credit/debit card details to Wallet from our App. I have the credit/debit card details for the user and when user tap on Apple Pay option in my App, the Add Card screen in Apple Wallet need to be opened with card data pre-populated. How do we achieve the same. Thanks in advance
The good news is that this can be done. What you are looking for is In-App Provisioning of Payment Cards. This is done using the PKAddPaymentPassViewController, which requires the com.apple.developer.payment-pass-provisioning entitlement key for your app. The bad news is that not anyone can submit apps with this entitlement as it requires special permission from Apple, which I believe is reserved for card issuers like banks and similar. If you believe that you qualify you need to contact Apple directly at apple-pay-inquiries#apple.com.
Apple only want to communicate with bank.#pajevic
Abreast of the times email address is: apple-pay-provisioning#apple.com
on the https://developer.apple.com/apple-pay/ we can find in Lower right corner

Testing in-app purchases

I want to test in-app purchases in my app on device with different Apple ID(not developer Apple ID). I add device in Apple Developer. But I still can’t do it. How I test purchases on device with not developer Apple ID?
if you're getting "Unknown Errors while creating Sandbox Tester, Please check Error Log, email=********#*****.****"
Here's the solution:
some email servers aren't accepted (for example #bk.ru didn't work, #gmail.com accepted);
you must use "strong" password (at least 1 capital letter, 1 number and 1 punctuation char);
you may not use same email address twice (even if previously removed).
Recommendation (also recommended by Apple): gmail supports "extended" pseudo-addresses you may (and should) use for sandbox users:
pretend you own myname#gmail.com - you may use myname+anythinghere#gmail.com (anything after + sign)
You must create Sandbox Tester Account to test In App Purchase.
For testing In App purchase you must have to use Sandbox Tester Account.
To add any sandbox testers, add a new user as admin and then login to itunes with the new admin account and try to add the sandbox testers. You will be easily add number of sandbox testers.
Let me know if you are still not able to add sandbox testers.

In App purchase for first time

I'm trying to implement in app purchase for first time. So I'm starting with a demo and my question is that if my purchase items are free and even app is free ,will it cost me anything because i don't have apple id of my own and i am using someone else's for generating certificates etc. As when i try to enable in app purchase in Xcode, its asks for apple id and password with whom the credit card is registered. The thing is that its not my account and i don't want to loose money only for demo.
As long as you are working in the sandbox, ie, not released, it will not cost you anything. You sign out of your personal (non-test) apple id in the Settings app and use a testing apple id you setup in iTunesConnect. If you are doing things correctly, you should not get asked for your credit card info. You will have to use a developer-registered apple id in Xcode, but this is for developer authorization, not payment.

Resources