#sainita_code
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sainita_code, 52 minutes ago, 29 messages
- sainita_applepay-link, 19 hours ago, 10 messages
- sainita_code, 23 hours ago, 4 messages
- sainita_apple-verification, 6 days ago, 13 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1260225234896818250
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
As mentioned in previous thread, I have registered domain in my connected account and got this response
Stripe\PaymentMethodDomain JSON: {
"id": "pmd_1PadOMHcs8fOq1ZEneTRZgGv",
"object": "payment_method_domain",
"apple_pay": {
"status": "active"
},
"created": 1720529014,
"domain_name": "dev.blinkpayment.co.uk",
"enabled": true,
"google_pay": {
"status": "active"
},
"link": {
"status": "active"
},
"livemode": false,
"paypal": {
"status": "active"
}
}
Can you share the site where you're seeing this behaviour?
oh, that one there
I have added script for apple pay but if link is enabled I am seeing link button. Though there is no script reg link and if link is disabled, then there is no button
Where is apple pay / ECE meant to appear? I see neither on that test page
It should be here.. inplace of link button
there is one div with id "PayByStripeApplePay" .. there it should be populated but if link enabled then link button is populated there and if disabled then that div is empty
This is my script
const expressAppleCheckoutOptions = {
buttonType: {
applePay: 'buy'
},
buttonTheme: {
applePay: 'black'
}
};
const appleElements = stripe.elements({
mode: 'payment',
amount: 1099,
currency: 'gbp',
});
const expressAppleCheckoutElement = appleElements.create(
'expressCheckout',
expressAppleCheckoutOptions
);
expressAppleCheckoutElement.mount('#PayByStripeApplePay');
expressAppleCheckoutElement.on('click', (event) => {
if($('input[name=rawAmount]').val() == '' || $('input[name=rawAmount]').val() < 1) {
swal_fire_error('Amount is required');
return;
}
var updatedAmount = ($('input[name=rawAmount]').val()) * 100;
var updatedCurrency = $('input[name=currency_name]').val();
appleElements.update({amount: updatedAmount, currency:updatedCurrency});
const appleOptions = {
elementType: 'expressCheckout',
expressPaymentType: 'apple_pay',
business: {
name: '{{$page->url}}'
},
emailRequired: true
};
event.resolve(appleOptions);
});
const handleAppleError = (error) => {
const appleMessageContainer = document.querySelector('#apple-error-message');
appleMessageContainer.textContent = error.message;
expressAppleCheckoutElement.on('confirm', async (event) => {
const {error: submitError} = await appleElements.submit();
if (submitError) {
swal_fire_error(submitError);
return;
}
const appleClientSecret = XXXXX
const {appleError} = await stripe.confirmPayment({
// elements instance used to create the Express Checkout Element
appleElements,
// clientSecret from the created PaymentIntent
appleClientSecret,
redirect: 'if_required',
confirmParams: {
return_url: "{{ route('public.page.success', $page->url) }}",
},
});
if (error) {
handleAppleError(error);
return;
} else {
}
});
In safari I only get the card form, no ECE (for link or apple pay)
I do get ECE (google pay) in chrome
link is disabled now, so you won't see that.. but apple pay should be there
Yes. We have google pay also which is working fine
The domain appears to be configured/registered correctly for the domain and that connects account, yes
Can you add logging to your stripe initialization to show which account ID you use?
Yes
I have just logged the details. It is showing the correct account id
"id": "pmd_1PadOMHcs8fOq1ZEneTRZgGv",
"object": "payment_method_domain",
"apple_pay": {
"status": "active"
},
"created": 1720529014,
"domain_name": "dev.blinkpayment.co.uk",
"enabled": true,
"google_pay": {
"status": "active"
},
"link": {
"status": "active"
},
"livemode": false,
"paypal": {
"status": "active"
}
} ---- Here livemode is showing false, will it be true?
livemode vs testmode depends on whether you're trying to do this in test mode (with a test PK) or live mode
Then you'd need to register the domain in live mode, too. But you should be testing in test mode first.
Is it possible to test the the payment in test mode?
We got the details that to test apple pay, we need to be in live mode
Is it possible to update this livemode value to true using API?
Is it possible to test the the payment in test mode?
Yes, switch to using your test keys on your site. Since this looks like a dev env you should likely be using that there already.
We got the details that to test apple pay, we need to be in live mode
Where were you told that? You can test Apple Pay in test mode, certainly.
Is it possible to update this livemode value to true using API?
No, you need to make a separate request using your live secret key to register for live mode, but I would suggest testing in test mdoe first.
ok
Yes. Now, in test mode I can see the button but after clicking the button and selecting a card, I am getting this error message in console and the page is stuck then. There is no message reg payment successful or failed
That first line suggests an integration error
An the later lines reveal what that might be
const appleOptions = {
elementType: 'expressCheckout',
expressPaymentType: 'apple_pay',
business: {
name: '{{$page->url}}'
},
emailRequired: true
};
event.resolve(appleOptions);
You shared that earlier, and it includes some invalid parameters
Specifically, the two mentioned in those errors
In this page , it is showing me those params
Hi there ๐ jumping as my teammate needs to step away soon. I'm not seeing the elementType or expressPaymentType parameters, that the error messages are saying aren't recognized/supported parameters, in the screenshot that you shared.
That's the event object, with the resolve function, not the parameters for resolve
Ok. If I remove these two params, still regarding the first error,