#jin_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1318682645181366332
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ can you clarify whether you've completed steps up to Step 4, or if you've completed Step 4 as well? Since Step 4 is adding the necessary capability.
step 1 is completed right? since I can complete payment with credit card
Ok, in that case, do you have Apple Pay setup on the device you're using for testing, and already have a card in that Apple Pay wallet?
yes I have apple pay set up on the device. there's a card in that Apple Pay wallet
i am using testing mode though
If you're in testmode, that just means we'll swap whatever card is actually in your wallet for our 4242 test card behind the scenes, but we still check that there is a card to simulate livemode behavior.
so you mean there's something other than not having an Apple Pay set up on the device, causing the issue?
step1 AppDelegate.swift (I skipped this)
Are we looking at the same guide? Step 2 in the guide you shared is to register for an Apple Merchant ID
Sorry, I don't understand what you're describing. Did you add StripeApplePay to your AppDelegate.swift file, or did you skip editing that file?
I don't have a AppDelegate.swift file in my project. I don't have any lines of code in the Stripe sample AppDelegate.swift file in my project either
Sounds like you aren't importing the necessary packages then to me.
If you don't have a .swift file, does that mean you're using Objective C for your app?
i am using SwiftUI
I have .swift files. I just don't have the AppDelegate.swift file
What are you using for package management?
using this for package management
Hm, is that what we refer to as "Manual Framework"?
The last tab here:
https://docs.stripe.com/apple-pay?platform=ios&lang-ios=swift#setup-client-side
i don't get what you mean?
I just added a AppDelegate.swift file like below to my project. Apple Pay still not showing up
Step 1 of the guide is about importing our necessary package into your app/project. If you aren't using Swift Package Manager, then you need to import that library for the package manager you're using. That's why we have 4 tabs in that section for different package management solutions.
I'm not intimately familiar with iOS, so I'm not sure what package manager you provided a link to the documentation for earlier.
oh ok. So I am using Swift Package Manager
StripeApplePay is already imported into my project using Swift Package Manager
Apple Pay still not showing up though
I'm a little confused, because my understanding is you would have had an AppDelegate.swift field present in your project if you were using the Swift Package Manager.
Maybe I didn't have a AppDelegate.swift initially because I used SwiftUI (not Swift), even though I used Swift Package Manager.
I have to manually add AppDelegate.swift when using SwiftUI. Not the case with Swift
๐ stepping in for my teammate. I'm also not too familiar with iOS so give me a few minutes to loop in someone else
okie thanks
Hi ๐
I'm hopping in here too. Can you tell me what step of this guide: https://docs.stripe.com/apple-pay?platform=ios you are currently on?
I completed steps 1 to steps 4. This is what I believe
I am using Stripe PaymentSheet so I didn't do anything step 5 and onwards
Okay and are you logging the results of this function to check if Apple Pay is supported?
StripeAPI.deviceSupportsApplePay()
not yet let me try
StripeAPI.deviceSupportsApplePay() is true
Okay nice.
And since you are using the PaymentSheet, you have completed all the steps here? https://docs.stripe.com/payments/accept-a-payment?platform=ios#ios-apple-pay
Specifically I'm wondering if you updated the PaymentSheet configuration like we show here
var configuration = PaymentSheet.Configuration()
configuration.applePay = .init(
merchantId: "merchant.com.your_app_name",
merchantCountryCode: "US"
)
i just added in these lines and apple pay showed up !
Woohoo! ๐
nice thanks