uni.getProvider({
service: 'payment',
success: (res) => {
const iapChannel = res.providers.find((channel) => {
return (channel.id === 'appleiap')
})
if (iapChannel) {
let ids = ['1234567890', '1234567892'];
iapChannel.requestOrder(ids, (
orderList) => {
console.log("----- order -----", orderList);
}, (e) => {
console.log('--- failed ---' , e);
});
uni.requestPayment({
provider: 'appleiap',
orderInfo: {
productid: that.productid,
manualFinishTransaction: true,
username: ress.data.orderId
},
success: (e) => {
that.isPayLoadding = false
},
fail: (e) => {
that.isPayLoadding = false
}
})
}
}
});
Apple Pay
RSS for tagDiscuss how to integrate Apple Pay into your app for secure and convenient payments.
Post
Replies
Boosts
Views
Activity
trying to email pkpass and when it is received, click on it and it asks which browser I want to use instead of opening pass and being able to save it to wallet. Tested email and it is working the way it should.
Hi team, just a few general questions about Apple Pay:
If user removes card from wallet, then re-adds it, will it preserve its Merchant Token (MPAN) or will a new one be generated?
Is the DPAN the same as applicationPrimaryAccountNumber in this page: https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/apple_pay/payment_token_format_reference
Can a user have the same card active simultaneously in two devices?
Thank you
Hi team @ Apple,
Is an MPAN always provided with an ApplePayPaymentToken?
I heard there are old devices that will provide only a DPAN. Is this correct, and do we need to support the case where only a DPAN is present?
I.e. what percentage of devices doesn't support MPAN?
Thanks
Does anyone else have this issue?
We have been having this issue for years since we start using Apple Pay on the Web.
I have checked TN3173 Your domain does not automatically re-verify section, we should meet all requirements.
I have emailed applepaymerchantsupport at apple.com several times (Case-ID: 7663879), either saying "still checking", or no response at all.
Our certificate for the Merchant Domains is maintained in Cloudflare, signed with Google Trust Service, rotate every 3 months.
Hi Guys,
I have asp.net web application targeting framework 4.7.2 . The requirement is to integrate apple pay to the site as a payment method.
Can any one help me on the below queries.
As the development will be in visual studio, is it require to have a apple developer account. if yes, which subscription is required (individual/organization). I believe to obtain merchantID, payment processing certificate apple developer account is required but not sure like which subscription is required.
Is there any supporting document or code snippet to integrate apple pay in .net application.
Is it required to use browser safari or iphone or ipad for testing the apple pay? can the testing be done using chrome browser?
Is it a direct integration using c# code or do I need to use any third party payment gateway like stripe, authorize.
Thanks in Advance
Apple pay working as except with in a domain, when we tried to access in cross domain works with simulations wallet cards . when i try to using in real cards it fails.
did anyone encounter this issue? Thanks in advance for your help!
We are updating the new certificates in our Non-Production environment.
The steps we followed,
Created and downloaded a new Merchant Identity certificate, converted and updated on our servers. Now we have a new certificate and an old certificate on the portal, both have valid expiration dates.
Created and downloaded a new Payment Processing certificate, converted and updated in our backed system (vault). Now we have a new certificate and an old certificate, both have valid expiration dates. However, activated the new Payment Processing certificate as it was showing only the previous one as Active, and Activate option was showing against the new one if we would like to do so. Doing this has automatically revoked the old certificate.
We have then tried testing the Apple Pay payments.
Result: We can see that the Merchant Validation API is going through successfully and returns the session object. But when the payment token is getting decrypted with the new Payment Processing certificate, private key, and ephemeral public key, the token is not getting decrypted. Instead, it was giving the error - javax.crypto.AEADBadTagException: mac check in GCM failed.
Even after a lot of troubleshooting and repeating the certificate update steps multiple times, we couldn’t find any clue. Then we tried the below few steps as part of further analysis.
We tried to decrypt the new payment token generated with the previous Payment Processing certificate and key which we reinstated in our backend. The decryption was successful. This was baffling as to why the new payment token which was generated as part of the new Merchant Identity certificate would get decrypted with the old Payment Processing certificate and key.
Then as we know that there were 2 Merchant Identity certificates active on the Apple portal, we have revoked the previous Merchant Identity certificate as well on the portal assuming the Merchant Validation API call would have been processed with the previous Merchant Identity certificate at Apple. Now when we tried the Apple Pay payments again with the new certificates all-around, the token decryption and hence the payment processing went through successfully.
Hence, the conclusion was that after creating and updating new certificates, the new Apple Pay payments are successful only when both the previous Merchant Identity and Payment Processing certificates are revoked. Is this a valid approach or are we missing something?
In our Production environment, we want to rotate the certificates without revoking the previous ones. Kindly let us know how we can achieve the same. Prompt replies are appreciated as expiry is nearing soon.
Hello,
I am developing Apple pay and In-app provisioning for the bank where I work, we have already configured all the entitlements, we are configured correctly with our PNO, When I use PKAddPaymentPassViewControllerDelegate I get to the terms and conditions part, but when I click accept , I am receiving the following error: "Could not add card"., and the log generated through the Wallet Profile on my iPhone is the following:
Response:
https://crt-pod1-smp-device.apple.com:443/broker/v4/devices/042727BD5C1D900232550083704076180311F218772B4987/cards/7bbe81aeb5ef4869aab8ebd9f45be840/enable 500 Time profile: 0.767163 seconds
{
x-conversation-id = "fccd73bcffbc4c3e9f85806647803b6b"
Vary = "accept-language"
Content-Type = "application/json"
x-pod = "crt-pod1"
x-keystone-correlationid = "B1F30C5D-AA1F-4729-B36E- 2C8516006C39"
Date = "Tue, 08 Oct 2024 17:28:40 GMT"
x-apay-service-response-details = "via_upstream"
Content-Length = "49"
x-envoy-upstream-service-time = "599"
x-pod-region = "paymentpass.com.apple"
}
{
errorCode = 40456;
statusCode = 500;
}
Can anyone please help me with this?
Regards,
Vinicius
Hi there,
So we have upgraded our Apple Pay JS API to 1.2.0 to take advantage of the ability to pay with Apple Pay on 3rd party browsers. But we seem to be getting a red banner at the top of the scannable code that appears that says "NOT FOR PRODUCTION USE" even though we are using a production certificate and payments are going into checkout.com as expected.
Is anyone else getting this and are we not doing something that we need to?
Thanks.
Hello,
We are developing a mobile application that will facilitate communication between landlords and tenants. One of the key features of the app will allow tenants to make rent payments to landlords directly using their credit cards.
However, I am concerned about Apple’s commission structure for in-app payments. Since these payments are for rent (not digital goods or services), I would like to understand if Apple’s standard 30% commission would apply to these transactions. If so, this would make the app less appealing for users who might prefer alternative payment methods outside the app.
Could you please clarify if such transactions fall under Apple's commission model, or if there are exceptions for rent payments and similar real-world transactions?
Thank you for your help!
Hi All,
I would like to know what kind of JWT I have to create.
This is the text from the Docs:
" get a JSON web token (JWT) from your payment service provider that includes the merchant’s unique identifier "
and
" Valid and signed token from a participating payment service provider. "
It's possible to have an example of JWT Token ? Because I tried some kind of JWT but I always got the same error:
" PaymentCardReaderError.invalidReaderToken(_:)
An error that indicates an invalid, non-empty reader token. "
https://developer.apple.com/documentation/proximityreader/adding-support-for-tap-to-pay-on-iphone-to-your-app
Thanks
Gianluca,
I am trying to find solutions past 4 days. but not getting any reference about NFC implementation in my app to read Debit/Credit card upon user consent? Can you confirm apple is provided any api for read Debit/Credit card using NFC or not. Tried with normal NFCReader but it reads only for normal tags but nothing with Visa/ MasterCard cards. Looking forward some help from you. Thanks
Hi everyone,
I’m encountering a challenge while working with Apple's PKPass for boarding passes and would appreciate any guidance.
We are generating boarding passes for users and want them to automatically display on the lock screen as the boarding time approaches. To do this, we are utilizing the relevantDate property.
The issue arises because, when setting the relevantDate, the date and time are specified in Zulu time (UTC). However, iOS converts this to the device's local time zone (BST in my case), resulting in a one-hour shift.
For instance, in pass.json, I set "relevantDate": "2024-10-03T14:35:00+00:00" (or "relevantDate": "2024-10-03T14:35Z"). While iOS does display the pass on the lock screen as expected, the notification shows the time as "Today at 15:25" instead of the correct "14:25."
Expected behaviour: the notication text should display the exact time set in the relevantDate( i.e. Today at 14:25).
Any insights on how to resolve this would be greatly appreciated!
Thank you!
I just updated to iOS 18 and now Apple Pay will not work??? Frustrating.
Hello ApplePay Support,
I am integrating apple pay support on the following page but getting error. I have attached code files and video also about debug that code with different response print. Please check it and let me know where is issue.
ApplePay Page:
https://payment.bestgoodstudio.com/uk/pay/
JS Code:
$(document).ready(function() {
function setupApplePayButton() {
var applePayButton = $('#apple-pay-button');
if (applePayButton.length) {
applePayButton.on('click', function() {
initiateApplePayPayment();
});
}
}
async function initiateApplePayPayment() {
if (!window.ApplePaySession) {
alert('Apple Pay is not supported in this browser/environment.');
console.error('Apple Pay is not supported in this browser/environment.');
return;
}
var request = {
countryCode: 'GB',
currencyCode: 'EUR',
supportedNetworks: ['visa', 'masterCard', 'amex'],
merchantCapabilities: ['supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit'],
total: {
label: 'Elitelab Pte Ltd',
amount: '2.50'
}
};
var session = new ApplePaySession(3, request);
session.onvalidatemerchant = async function(event) {
const validationURL = event.validationURL;
alert("Validation URL received: " + validationURL);
try {
const response = await fetch('https://payment.bestgoodstudio.com/uk/pay/apple_pay_validation.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ validationURL: validationURL })
});
const responseBody = await response.text(); // Get raw text to print whole response
alert("Validation Response (raw): " + responseBody); // Print raw response in alert
if (response.ok) {
const responseData = JSON.parse(responseBody); // Parse it if valid JSON
alert('Validation Response (parsed): ' + JSON.stringify(responseData));
console.log('Merchant Validation Data:', responseData);
if (session) {
session.completeMerchantValidation(responseData);
alert('Merchant validation completed.');
}
} else {
alert("Merchant Validation failed. HTTP Status: " + response.status);
session.abort(); // Abort session if validation fails
}
} catch (e) {
alert('Error during Merchant Validation: ' + e.message);
console.error('Merchant validation error:', e);
session.abort(); // Abort session on error
}
};
session.onpaymentauthorized = function(event) {
var payment = event.payment;
var paymentToken = payment.token.paymentData;
alert("Payment authorized. Payment Data: " + JSON.stringify(payment));
console.log('Payment Authorized:', payment);
processApplePayPayment(payment, function(success) {
if (success) {
session.completePayment(ApplePaySession.STATUS_SUCCESS);
alert('Payment completed successfully.');
} else {
session.completePayment(ApplePaySession.STATUS_FAILURE);
alert('Payment failed.');
}
});
};
session.oncancel = function(event) {
alert("Session canceled: " + JSON.stringify(event));
console.log("Session canceled:", event);
};
session.oncomplete = function(event) {
alert("Session complete: " + JSON.stringify(event));
console.log("Session complete:", event);
};
session.begin();
}
function processApplePayPayment(payment, callback) {
var postData = {
paymentData: payment.token.paymentData,
billingContact: payment.billingContact,
shippingContact: payment.shippingContact
};
$.ajax({
url: 'process_apple_pay.php',
method: 'POST',
data: JSON.stringify(postData),
contentType: 'application/json',
success: function(response) {
alert("Payment Processing Response: " + JSON.stringify(response));
console.log("Payment Processing Response:", response);
callback(response.success);
},
error: function(error) {
alert('Error processing payment: ' + JSON.stringify(error));
console.error('Error processing payment:', error);
callback(false);
}
});
}
setupApplePayButton();
});
PHP Code:
Hello,
I have existing application that was created 2 years ago and we wanted to start developing wallet, but in order to do that I need to create new Identifiers with In-App Provisioning but unfortunately it is missing. Any idea on how to solve that?
Hi there, I'm using a PHP library to generate a apple wallet card. In the end my code generates a .pkpass file, but for some reason iOS does not recognize it as a wallet object, instead just as a .pkpass file which in can save in my downloads/documents. Any idea?
Hi,
We have a bank app which can activate tokenized payment cards (in Requires Activation status) on Apple devices.
In my case some customers tried to activate their card token on their Apple Watch. Our card system gathered all the required card data with the PNO and sent them to our app. Our app called the PKPassLibrary.activate() method, but got back the Swedish localizedDescription "Oväntat fel" which means "Unexpected error" in English. We checked our card system logs and contacted our PNO, both found no issue and no explanation to the unexpected error. How can we identify the issue here? Can we somehow find a more detailed error log from Apple Server?
Best regards,
Adrian Lui
Hi there, I'm using php to create a qr code card for your apple wallet. Hereby I'm using this package: https://github.com/chiiya/laravel-passes Currently I got this far, that it creates a temporary directory filled with the needed files, including: icon.png, logo.png, manifest.json, pass.json and a signature file. After that temp directory gets created it creates a .pkpass file. Which will be downloaded to your system using an anchor tag button with controller method behind. For some reason on my iPhone I can only download it as file (the .pkpass file) and not as an actual wallet card. Any idea what is going wrong?