Diagnose common errors received while displaying the Apple Pay button on your
website by identifying the underlying causes, and explore potential solutions.
View Technote TN3175 >
Apple Pay
RSS for tagProvide a fast, easy, and secure way for users to buy goods and services in your app or on your website using Apple Pay.
Posts under Apple Pay tag
162 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Diagnose errors received while presenting the Apple Pay payment sheet on
your website by identifying the underlying causes of common errors and explore
their potential solutions.
View Technote TN3174 >
I am getting error while await applePayClient.PostAsJsonAsync(validationUrl, validationPayload)
I am testing it on local machine. Am I even can test this on local machine or not?
Error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
validationUrl: https://apple-pay-gateway.apple.com/paymentservices/startSession
JS
C# code:
var applePayClientHandler = new HttpClientHandler
{
SslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13
};
var applePayClient = new HttpClient(applePayClientHandler);
var merchantId = "merchant.com.xxxxxx.sandbox";
var _displayName = "Sandbox";
var domainName = "xxxxxx.co";
var validationUrl = request.ValidationURL;
var validationPayload = new
{
MerchantIdentifier = merchantId,
DisplayName = _displayName,
Initiative = "web",
InitiativeContext = domainName
};
try
{
var response = await applePayClient.PostAsJsonAsync(validationUrl, validationPayload);
var merchantSession = await response.Content.ReadAsStringAsync();
return merchantSession;
}
catch (HttpRequestException httpEx)
{
// Log detailed HTTP request/response information
Console.WriteLine($"HttpRequestException: {httpEx.Message}");
if (httpEx.InnerException != null)
{
Console.WriteLine($"InnerException: {httpEx.InnerException.Message}");
}
throw;
}
Hello,
We are facing an issue with our customers on in-app purchasing.
One of our customers tried to get a yearly subscription on 23rd May 2024 but could not succeed due to a billing error. But on 19th June 2024, his subscription was purchased automatically for 1 year, and the package expiry date shows 19th June 2025.
So why did Apple charge to customer after 1 month without any intimation?
Can anybody help here?
Thanks
While Implementing Wallet Intent Extension, and after verification
The only message i get is
Cannot Add Card
There are no available cards to add.
Any help here is appreciated.
While Implementing Wallet Intent Extension, and after verification
The only message i get is
Cannot Add Card
There are no available cards to add.
Any help here is appreciated.
Hello.
I have a mobile iOS app Im connecting with Stripe currently. Ideally to have content creators get paid based off their content. My question is, is this best approach to getting creators paid and are able to do this with Apple.
If my iOS app allows for creators to create content and lock it for their audience. their subscribers can pay a onetime or an ongoing subscription to unlock their content like articles for example. I give them an 8% platform fee.
However we are using apple pay for their supporters to also pay with to unlock their content. This means we need to abide by the 30% Apple cut.
These creators are based in different countries, as well as their supporters are also based in different countries.
We use Stripe to connect these dots. Allowing the creator to signup through Stripe as a business. Their supporters pay with Stripe (Apple Pay and / or Card) We then allow them to get paid out what they earned from the supporter. All through Stripe.
Question:
Is this a good way of going about it?
Would we get rejected?
**Payout question **
Is there another way of handling this? Outside of Stripe?
**Sales Tax ** I would love to understand this and find a process I can follow to be successful.
I'm pretty new to sales tax world. Has there been a successful process that anybody else follows and can share? To calculate sales tax and do this on a yearly basis? For not only the US, but if your product is also in different countries.
Again I don't really know this sales tax stuff and I'm trying to learn it as I go.
All the best
Hi,
I know it's currently possible to import a virtual debit/credit card from a mobile app into the IOS Wallet using PassKit from the Apple SDK, but I haven't seen any documentation to do it directly from a web app, could you please tell me if it is possible to do it directly from a web app without using a mobile app?
And if so, point me to some documentation?
Thanks in advance
Hi,
I'm adding ApplePay to our website. It works perfectly. However, I want to hide the ApplePay button on devices that do not have an Apple Wallet configured. I am using the following code to verify this as per ApplePay documentation.
function ShowApplePayButton() {
if (window.ApplePaySession) {
if (ApplePaySession.canMakePayments()) {
if (ApplePaySession.canMakePaymentsWithActiveCard('visa') ||
ApplePaySession.canMakePaymentsWithActiveCard('masterCard')) {
return true;
}
}
}
return false;
}
This function always returns true from a Mac with no wallet configured. So the applePay button is visible on the Mac. When I click on the ApplePay button, there is no option to add or update the Wallet.
This is my ApplePay sample code
function onApplePay() {
if (!ApplePaySession) {
return;
}
var grandTotal = "10";
// Define ApplePayPaymentRequest
const request = {
countryCode: 'GB',
currencyCode: 'GBP',
merchantCapabilities: ['supports3DS'],
supportedNetworks: ['masterCard', 'visa'],
total: { label: 'Total', amount: grandTotal, type: 'final' },
requiredBillingContactFields: ["postalAddress", "name", "phone", "email"],
requiredShippingContactFields: ["postalAddress", "name", "phone", "email"]
};
// Create ApplePaySession
const session = new ApplePaySession(3, request);
session.onvalidatemerchant = async event => {
// Call your own server to request a new merchant session.
const merchantSession = await getAsync("/test/ValidateMerchant", "", "json")
session.completeMerchantValidation(merchantSession);
};
session.onpaymentmethodselected = event => {
const update = {
newTotal: { label: 'Total', amount: grandTotal, type: 'final' }
}
session.completePaymentMethodSelection(update);
};
session.onshippingmethodselected = event => {
const update = { newTotal: { label: 'Total', amount: grandTotal, type: 'final' } };
session.completeShippingMethodSelection(update);
};
session.onshippingcontactselected = event => {
};
session.onpaymentauthorized = event => {
const result = {
"status": ApplePaySession.STATUS_FAILURE
};
const payment = event.payment;
aj.post('/test/ProcessPayment', body, function (response) {
if (response.approved) {
session.completePayment(ApplePaySession.STATUS_SUCCESS);
} else {
session.completePayment(ApplePaySession.STATUS_FAILURE)
}
}, function (xhr, ajaxOptions, thrownError) {
console.log(thrownError);
}, true, 'json');
};
session.oncancel = event => {
// Payment canceled by WebKit
};
session.begin();
}
Could you please suggest a workaround to resolve this issue?
Diagnose errors due to invalid Apple Pay merchant identifier configurations by identifying the underlying causes of common errors and explore their potential solutions.
View Technote TN3173 >
Hello,
I've recently created a merchant ID and added two domains to it. I placed the verification .txt files in the right place (under the .well-known dir) and both verified successfully and show as such in the merchant id setup page.
I am intermittently getting the following error:
{
"statusMessage": "Payment Services Exception merchantId=XXXXX not registered for domain=my.domain.com",
"statusCode": "400"
}
(merchantId and domain have been masked in the above error) -- What's odd is that this is intermittent -- It'll work fine, and then stop and start giving the above error, and then start working fine again, with no intervention from me.
Some context: This is a single server application, so it's not like we've got a server out of sync somewhere.
Thoughts?
Any thoughts?
For American Express cards, as of June 2024, no test cards from https://developer.apple.com/apple-pay/sandbox-testing/ can be added to the Sandbox Apple wallet and got this error. has reached out to Apple Pay Support.
The device region, test account, app store settings are all pointing to United States as region.
Hello there,
I have a couple of question about Apple Pay guidelines:
• if we offer Apple Pay payment method in our app, can we disable the selection (I mean the method selection NOT the Payment button!) IF certain condition happens? E.g. the user cannot select apple pay payment method because our basket is not ready yet.
• Are we forced to move the apple pay payment method on the top of our selection? E.g. Cards, Cash On Delivery, Coupon, Apple Pay --> Apple Pay, Cards, Cash On Delivery, Coupon
One last technical question:
• when we start the payment process we are gonna create the request and present the sheet BUT we have to call our backend for pre-authorization, is it allowed?
@objc private func applePayButtonTapped(sender: UIButton) {
// TODO: Is it allowed?
// We need to ask to our backend a pre-authorization and THEN procced with Apple Pay flow
// but this could be done ONLY after the user TAP on BUY with APPLE PAY and BEFORE
// paymentAuthorizationViewController is called.
// Are we compliant to do that?
if PKPaymentAuthorizationViewController.canMakePayments(usingNetworks: FakeData.paymentInfo()) {
let request = PKPaymentRequest()
request.blablabla = blabla
let authorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: request)
if let viewController = authorizationViewController {
viewController.delegate = self
present(viewController, animated: true, completion: nil)
}
}
}
Thanks in advance :)
I'm developing an application where user can access contents based on In-app purchase subscription.As per the app requirement I want to restrict user from accessing the content when they try to access from a different country.
Example:
Being a user I brought subscription while I was in India by paying lets say 10$ instead of actual 20$ (50% discount for India users).
Lets say I am travelling to other country and in order to use the content user now has to pay the remaining 10$.
As per apple's policy is this allowed? , if yes, then how to achieve this.
Hello!
For Apple Pay, I'd like to disable the option for a customer selecting Apple Pay Later (tab).
In Swift, very easily modify the PKPaymentRequest with:
if #available(iOS 17.0, *) {
paymentRequest.applePayLaterAvailability = .unavailable(.itemIneligible)
}
However, how can this be setup to test that it works?
Very easily add sandbox account, and test cards, but not so easy to enable Apple Pay Later, or documented so the end user (tester) can test it.
Anyone know how to go about setting this up?
Thanks!!
Subject: Clarification on App Store Policy Regarding Payments Through Telegram Bots
Dear Apple Team,
My name is Fedor Skuratov, and I am a CEO at Combot.org. We have received a notification from Telegram (Telegram.org) regarding the necessity to switch to a new payment mechanism—Telegram Stars — for all bots that accept payments for digital goods and services.
This is the text of their announcement:
URGENT Action Required
Dear Bot Developer,
Apple has informed Telegram that @combot is in violation of App Review Guidelines 4.7 and 3.1.1, because it accepts payments for digital goods and services directly from customers without relying on Apple's in-app purchase mechanism.
To ensure that Telegram bots/mini apps such as yours continue operating without interruption on all platforms, we have developed a way for third-party developers on Telegram to accept payments from their customers that is compliant with the App Store and Play Store policies.
To this end, we are rolling out a new in-app currency, Telegram Stars, which users will be able to acquire from Telegram using standard Apple and Google in-app purchases and then use to buy digital goods and services from you. Developers will be able to review their Telegram Stars balance and withdraw them at any time using the TON blockchain.
Starting on June 12, all payments for digital goods and services in bots and mini apps will have to be carried out exclusively in Telegram Stars. Since Telegram has to follow the Guidelines imposed on us by the app stores, failure to comply with these changes will result in the suspension of @combot for most of your customers.
We will publish the full updated API documentation within the next few days, but you can already prepare your bots and mini-apps for the upcoming changes. To accept payments for digital goods and services, you will need to use the sendInvoice or createInvoiceLink methods with the currency field set to "XTR" and the provider_token field left empty.
We expect these changes to positively impact the conversion rate for payments from customers in most markets.
Payments for physical goods and services remain unchanged.
More details will be published on @botnews soon.
The Telegram Team
These changes have raised several questions and concerns as they directly impact our business. We would like to seek clarification on the following points:
**Apple's Requirements:
**
What specific requirements has Apple set for Telegram and bot developers regarding payments for digital goods and services?
Is this requirement initiated by Apple or is it solely a decision by Telegram?
**Apple's Commission:
**
According to the new rules, Telegram proposes using in-app currency (Telegram Stars) for all payments for digital goods and services, which adheres to the Apple/Google commission (~30%). These changes can negatively affect existing business models.
Are there any plans to ease the conditions or provide additional time for adaptation to the new requirements?
Jurisdictional Issues:
In most jurisdictions, receiving payments for digital goods in cryptocurrency (including TON/Telegram Stars) is illegal. How does Apple plan to address this issue in your relations with Telegram and businesses which uses the bot functionality in Telegram app?
Application of Rules:
Do these requirements apply only to those developers using in-app Telegram Payments 2.0, or to all who sell any services and have links to these services in its bots?
Payments on Third-Party Websites:
Our service (Combot.org) which is a moderation an community management tool for communities including Telegram chats, uses Stripe to accept payments on our website, and the bot acts as an agent in chats and does not handle payments. How do Apple's new requirements relate to such business models?
We appreciate your assistance and understanding in this matter. Thank you in advance for your clarification.
Sincerely,
Fedor Skuratov
CEO
Combot.org
Hi,
I'm adding deferredPaymentRequest container to get MPan, but payment is now cancelled by Webkit, no other explanation
What is the next step to get mpan ?
Regards,
Louis
"deferredPaymentRequest": {
"deferredBilling": {
"label": "Deferred Payment",
"amount": "1.99",
"type": "final",
"paymentTiming": "deferred",
"deferredPaymentDate": "2024-06-1",
},
"managementURL": 'https://.../apmsim/pay/appleManagement',
"paymentDescription": "this is a paymentDescription",
}
I am developing a VisionOS application with IAP which has not yet been submitted for review. In the process of development, while using the payment feature under the sandbox environment, the store returns the following error:
explanation = "Purchasing is not currently available on this device in your country or region. Purchases you make on an iPhone, iPad or Mac can still be accessed here.\n\n[Environment: Sandbox]"
How should I handle this? change another country or region ?
thanks
does anyone have an example of the decrypted payload for an interac payment would look like? Couldnt find an example within the apple documentation
We are getting this error when processing our registration.
Payment Services Exception Domain check failed with the following errors. No domains were registered.\nDomain verification failed for pspId=1A014B2EC09DB380EE1D51FE4D116C801F62F29D74F2D93269FE554CA2E34656 domain=patient.moolah.cc url=/.well-known/apple-developer-merchantid-domain-association errorMessage=com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4559 path $", "statusCode": "400"}