Apple Developer Program

RSS for tag

Create and deliver software for users around the world on Apple platforms using the the tools, resources, and support included with Apple Developer Program membership.

Apple Developer Program Documentation

Posts under Apple Developer Program subtopic

Post

Replies

Boosts

Views

Activity

Apple pay processing payment fail
Hey, I am trying to implement the apple pay process pay backend service, I have checked everything and somehow it fails. I only have 1 certificate for merchant and 1 for the apple pay process, I have the private keys and try to run this following code that fails - import crypto from 'crypto'; import fs from 'fs'; import forge from 'node-forge'; const MERCHANT_ID_FIELD_OID = '1.2.840.113635.100.6.32'; function decryptedToken() { const token = ""; const ephemeralPublicKey = ""; const encryptedData = ""; //=================================== // Import certs //=================================== const epk = Buffer.from(ephemeralPublicKey, 'base64'); const merchantCert = fs.readFileSync('merchant_full.pem', 'utf8') const paymentProcessorCert = fs.readFileSync("apple_pay_private.pem"); //=================================== let symmetricKey = ''; try { symmetricKey = restoreSymmetricKey(epk, merchantCert, paymentProcessorCert); } catch (err) { throw new Error(`Restore symmetric key failed: ${err.message}`); } try { //----------------------------------- // Use the symmetric key to decrypt the value of the data key //----------------------------------- const decrypted = JSON.parse(decryptCiphertextFunc(symmetricKey, encryptedData)); console.log("Decrypted Token:", decrypted); // const preppedToken = prepTabaPayToken(token, decrypted) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Send decrypted token back to frontend //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // res.send(preppedToken); } catch (err) { throw new Error(`Decrypt cipher data failed: ${err.message}`); } } // extractMerchantID - const extractMerchantID = (merchantCert) => { //=================================== // Extract merchant identification from public key certificate //=================================== try { const info = forge.pki.certificateFromPem(merchantCert); const result = info['extensions'].filter(d => d.id === MERCHANT_ID_FIELD_OID); //----------------------------------- // Return //----------------------------------- return result[0].value.toString().substring(2); } catch (err) { throw new Error(Unable to extract merchant ID from certificate: ${err}); } } // generateSharedSecret - const generateSharedSecret = (merchantPrivateKey, ephemeralPublicKey) => { //=================================== // Use private key from payment processing certificate and the ephemeral public key to generate // the shared secret using Elliptic Curve Diffie*Hellman (ECDH) //=================================== const privateKey = crypto.createPrivateKey({ key: merchantPrivateKey, format: "pem", type: "sec1", // because it's "EC PRIVATE KEY" }); const publicKey = crypto.createPublicKey({ key: ephemeralPublicKey, format: 'der', type: 'spki' }); //----------------------------------- // Return //----------------------------------- return crypto.diffieHellman({privateKey,publicKey: publicKey,}); //----------------------------------- } // getSymmetricKey - const getSymmetricKey = (merchantId, sharedSecret) => { //=================================== // Get KDF_Info as defined from Apple Pay documentation //=================================== const KDF_ALGORITHM = '\x0didaes256GCM'; const KDF_PARTY_V = Buffer.from(merchantId, 'hex').toString('binary'); const KDF_PARTY_U = 'Apple'; const KDF_INFO = KDF_ALGORITHM + KDF_PARTY_U + KDF_PARTY_V; //----------------------------------- // Create hash //----------------------------------- const hash = crypto.createHash('sha256'); hash.update(Buffer.from('000000', 'hex')); hash.update(Buffer.from('01', 'hex')); hash.update(Buffer.from(sharedSecret, 'hex')); hash.update(KDF_INFO, 'binary'); //----------------------------------- // Return //----------------------------------- return hash.digest('hex'); //----------------------------------- } // restoreSymmetricKey - const restoreSymmetricKey = (ephemeralPublicKey, merchantCert, paymentProcessorCert) => { //=================================== // 3.a Use the payment processor private key and the ephemeral public key, to generate the shared secret //=================================== const sharedSecret = generateSharedSecret(paymentProcessorCert, ephemeralPublicKey); //----------------------------------- // 3.b Use the merchant identifier of the public key certificate and the shared secret, to derive the symmetric key //----------------------------------- const merchantId = extractMerchantID(merchantCert); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Return //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ console.log("Merchant ID:", merchantId); console.log("Shared Secret (hex):", sharedSecret); return getSymmetricKey(merchantId, sharedSecret); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } // decryptCiphertextFunc - const decryptCiphertextFunc = (symmetricKey, encryptedData) => { console.log("🔑 Decrypting Ciphertext with Symmetric Key:", symmetricKey); //=================================== // Get symmetric key and initialization vector //=================================== const buf = Buffer.from(encryptedData, 'base64'); const SYMMETRIC_KEY = Buffer.from(symmetricKey, 'hex'); const IV = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); // Initialization vector of 16 null bytes const CIPHERTEXT = buf.slice(0, -16); //----------------------------------- // Create and return a Decipher object that uses the given algorithm and password (key) //----------------------------------- const decipher = crypto.createDecipheriv("aes-256-gcm", SYMMETRIC_KEY, IV); const tag = buf.slice(-16, buf.length); decipher.setAuthTag(tag); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Load encrypted token into Decipher object //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let decrypted = decipher.update(CIPHERTEXT); console.log("🔑 Decrypted Data"); decrypted += decipher.final(); //::::::::::::::::::::::::::::::::::: // Return //::::::::::::::::::::::::::::::::::: return decrypted; //::::::::::::::::::::::::::::::::::: } decryptedToken();
2
0
105
Sep ’25
Cannot renew Apple Developer membership - there is no Renew button
My Apple Developer membership has expired and as a result I can't publish app updates and my app is no longer visible on the App Store. I'm trying my best to renew my membership, but there is no "Renew" button where it should be, as reported by multiple sources from Apple. I've tried web, the Developer on macOS, the Developer app on iOS, but there is nowhere a "Renew" button to be found. If I login with another (old) account I can see the renew button where there is none on my other account. I've contacted Apple Developer support, but they are not responding. Seems like I'm stuck. Does anyone have experience with this particular problem? How did you solve this problem?
1
1
234
Jul ’25
enrollment
My case is 102643649532, I'm on my account page, I click enroll, then it opens the enroll status page and there is an explanation saying "Contact us to continue your enrollment. You’ve exceeded the maximum number of attempts. Please contact us.". In this case, what should I do if I want to apply for an organization account?
1
0
219
Jul ’25
Publish IPA
Hello everyone, I build and run the app in iPhone in developer mode but now i am trying to install and run the app in another iPhone in which i did not turned on the developer mode. it installed but not opening without the Developer mode. Is there any another way to install and run the app with Developer mode for one time. If not then tell me the process how i can do publishing in testFlight or appStore. Thanks
1
0
77
Jul ’25
Error Adding Account to Visual Studio 2022
I'm trying to add an Enterprise Apple account with the username and password of my developer account, which has worked once before. Now its giving me the following error: "There was an error while trying to log in: No trusted devices or trusted phone numbers are configured for this account." which doesn't make sense because the 2-Factor Auth works when I login to the website. What am I missing? I think the only thing different is I'm using a different Macbook, but should that make a difference? Has anyone else had this error from Visual Studio?
1
0
71
Mar ’25
MacBook developer mode force enabled
I have a MacBook with AppleCare+ recently purchased retail (no business account or associated developer account) from the Cupertino visitor center store that is configured with developer mode force enabled. Is it expected for a retail purchased, non-provisioned device to be set up with developer mode force enabled? Or did I hit the lotto?
1
0
179
Jul ’25
Problem to enter iCloud six-digit verification code
When I have created my developer account I do it on a MacPro 2019. Now I develop to a new silicon Mac. To submit the (Mac) application App store Connect give a six-digit verification code. This code must be enter to popup window that appear on Desktop. But the popup window appear on MacPro 2019 instead of silicon Mac. How can I receive popup window in the silicon Mac Desktop, not in MacPro 2019 ? iCloud staff tell that it imposible to change the computer destination that receive popup window... Is it true ? Yes, I can use phone to enter the six-digit verification code but it is very more easy to enter the code in the popup window.
1
0
114
Jul ’25