#BruceWayne
1 messages · Page 1 of 1 (latest)
hi
hello! i'm sorry but i don't understand, can you rephrase?
Our dev is deploying stripe's online payment API
After the deployment is successful, the subtotal, total and tax prices are not visible on the payment page we see. How do we display these three parameters?
Normally, the three parameters I just mentioned will be displayed in the red box, but there is no such thing. Is this something we have forgotten?
How do I add these three parameters and how do I display them?
can you share the checkout session id?
https://dashboard.stripe.com/test/logs/req_I5BDjsqqfUWmTt - you haven't tax, also, this is a one time payment, not a subscription
One-time payments don't show that information, do they?
How do I tell the customer that the tax is included in the price and does not need to be paid by the customer. How should I set the parameters?
the tax portion should be shown if you use Stripe to handle tax. The other fields would be included where relevant. If you only have a single item and no tax, then we show that UI in the screenshot you shared
maybe you can add additional information here? https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_text-submit
OK
Then there is another problem. When I create a checkout session, when I choose Alipay payment method, I can't choose the currency unit of USD. Why?
When I set up USD with Alipay, it says I can't create a checkout session
AliPay and WeChat will only be offered in the default settlement currency of your Stripe account. So if your Stripe Account is in JP, then you can only use Alipay for JPY transactions
I need to emphasize that I'm using test mode, not real mode.
Where can I check my default billing currency?
your account is a HK account, so the default settlement currency is HKD
How can I modify it to USD?
that's not possible. The default currency is tied to the country your Stripe account is in
if you want to accept USD for Alipay, you can reach out to Stripe Support to see if it can be enabled for you
OK
Or, I add a USD bank account and set it as USD settlement, is that ok?
Is this a good idea?
adding a USD bank account won't allow you to accept USD payments using Alipay on your account.
You need to reach out to Stripe Support to see if it's possible to enable USD payments using Alipay for your Stripe account.
thanks
hi
The support staff has enabled Alipay for me, he said that I can receive Alipay in USD, and now I have to ask dev to set up Alipay in USD in the API?
you can try testing it out to see if it works
thanks
When the customer pays successfully, I want to send her a receipt. What do I need to do in the API
Pre-filling customer email addresses, yes?
You don't necessarily need to prefill it, if the Customer doesn't have an email, they will need to fill it up before they can make payment via the Checkout Session.
https://stripe.com/docs/receipts - note that test payments created using your test API keys don’t automatically send receipts. Instead, you can view or manually send a receipt using the Dashboard.
OK,thanks
One more question, sorry.
The API I'm plugging into now, when I successfully create a checkout session, can I still create a payment link?
I then send them the payment link
Checkout Session is a one-time payment link, why do you want to create a new one if one already exists?
I thought he could only access the website and provide online payment for our website
It seems, I can also manually send this link to the customer ? Don't need to put it on the website as a jump to let customers pay?
I can use both ways, right?
it's all up to me
After creating a Checkout Session successfully, a URL will be generated. You can either redirect the customer to the URL on the website or send him/her the URL
Both way work
That would be great, thank you so much for your help
No problem! Happy to help 😄
I have a question about product prices. Our users pay different amounts every time. Do I need to create new products and prices every time?
In this way, I will have an infinite number of products, will he have an upper limit? Or is there another way to solve this problem?
You can create adhoc product and price instead of pre-creating them with price_data and product_data. Example request can be found here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#redirect-customers
This means that every time I create a checkout session, I create a new product price, without referencing any product id, right?
This is my checkout session id, am I doing it right?
"id": "cs_test_a1WjcmibmpjbkdvVCxleH0X0ZG9K0hNcojo56mNTvNjlIdtVv6Zufzkih3",
In https://dashboard.stripe.com/test/logs/req_I5BDjsqqfUWmTt, I don't see you using price_data. You still create a price first, then set it into line_items.price
So do I need to modify the API?
Yes, you should use price_data and product_data when creating Checkout Session instead of pre-creating products and prices. For example,
const session = await stripe.checkout.sessions.create({
line_items: [
{
price_data: {
currency: 'usd',
product_data: {
name: 'T-shirt',
},
unit_amount: 2000,
},
quantity: 1,
},
],
mode: 'payment',
success_url: 'http://localhost:4242/success',
cancel_url: 'http://localhost:4242/cancel',
});
In this way, my dashboard-products will display a lot of temporary products, right?
Product created from product_data won't be shown in Dashboard
This is the ad-hoc product and price, not permanent
Only permanent product and prices will be shown in the Dashboard
I'd recommend giving a try and check if it works for you
No problem! Happy to help 😄
I still can't set Alipay to USD
I have opened Alipay
Stripe.StripeException:“Invalid currency options usd. The payment method alipay only supports the following currencies: cny, hkd.
How is this going
Can you share the request ID (req_xxx) of the error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_gXeYUt2SEoIrEi
Thanks for sharing. Your account country is HK. For HK account, Alipay can only process CNY and HKD, but not USD
The presentment currency of Alipay depends on the country of your account
But I contacted support and he said I can receive Alipay in USD
It's likely the Support isn't aware that your account country is HK
https://stripe.com/docs/payments/alipay
I saw in the above document that he said: If you have a bank account in another currency and want to create an Alipay payment in that currency, you can contact support. Whether other currencies are supported depends on your specific situation.
So, even if I followed the documentation and created a bank account in another currency, say USD, I still can't pay in USD, is this a confirmed fact?
In https://dashboard.stripe.com/settings/payouts, I don't see you having a bank account in USD like what the doc mentioned
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You can create Alipay payments in the currencies that map to your country. The default local currency for Alipay is cny and customers also see their purchase amount in cny.
If you have a bank account in another currency and would like to create an Alipay payment in that currency, you can contact support. Support for additional currencies is provided on a case-by-case basis.
I don't see you setting up USD in your https://dashboard.stripe.com/settings/payouts
you have a bank account in another currency
this
But it's not shown in the above page
That means, I need to create a USD bank account first and set USD as the default settlement currency, so I can add USD to Alipay, right?
Then I can use the API to create USD Alipay?
You'd need to create a USD bank account and set it the Dashboard, yes. It's not necessary to set as default
Then I can use the API to create USD Alipay?
Yes
Oh, I can just create a US dollar bank account, but I can still set HKD as the billing currency? Sounds good
I'm not too sure if the alipay in USD will settle to USD or HKD bank account in such a case. I'd recommend double checking with Support about that
👍
Stripe.StripeException:“Invalid payment_method_types[0]: must be one of card, acss_debit, affirm, afterpay_clearpay, alipay, au_becs_debit, bacs_debit, bancontact, blik, boleto, cashapp, customer_balance, eps, fpx, giropay, grabpay, ideal, klarna, konbini, link, oxxo, p24, paynow, paypal, pix, promptpay, sepa_debit, sofort, us_bank_account, wechat_pay, or zip”
Can you share the request ID (req_xxx) of the error?
when i created google pay he got error
google pay is part of card payment method types
if you have card type, it will include google pay and apple pay
req_gWBSVtyVkj3AKJ
To use wechat pay in Checkout Session, payment_method_options.wechat_pay.client: 'web' should be set: https://stripe.com/docs/payments/wechat-pay/accept-a-payment?platform=checkout#enable-wechat-pay-as-a-payment-method
We don't need WeChat Pay, we need Google Pay, did we get it wrong?
In https://dashboard.stripe.com/test/logs/req_gWBSVtyVkj3AKJ, you set the paymen method types to alipay and wechat_pay
If you wish to accept google pay, it should be set payment_method_types should be set to card
card includes card, apple pay and google pay
If you don't set payment_method_types at all, it will use the automatic payment methods configure in https://dashboard.stripe.com/test/settings/payment_methods
OK
payment_method_types= card
Do I just have to set this up? Do I need to set anything else?
I don't need to choose Google Pay again?
so that customers only see google pay?
I chose card, but my payment page still asks me to enter my bank card number, and I cannot use Google Pay
When you choose card, the payment page will provide Google Pay (if browser supports), Apple Pay (if browser supports) and card options
You can't have a Checkout Session only with Google Pay
I'm able to see Google Pay on this page
Have you logged into your Google account in the chrome browser and have a card saved in the Google Pay wallet?
Google Pay button will only show if these requirements are fulfilled: https://stripe.com/docs/stripe-js/elements/payment-request-button?client=html#html-js-testing
NO
So can I disable Google Pay and Apple Pay? Is it okay to only display card payment?
Hi! I'm taking over this thread.
You want to disable Google/Apple Pay from your Checkout Session?
yes
You can disable them here: https://dashboard.stripe.com/test/settings/payment_methods
It can't be disabled in the API is it?
For Checkout Session I don't see a way to disable Google/Apple Pay with the API.
OK,thanks
How do I know how much I got in the end when the customer pays successfully?
How can I check the actual amount I get after deducting the handling fee? Do I need to calculate it myself?
You could look at the PaymentIntent object in the Checkout Session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
And to see the Stripe fee: https://stripe.com/docs/expand/use-cases#stripe-fee-for-payment
Please help me to point out which one represents the amount of the handling fee and which one represents the amount after deducting the handling fee?
fee is the total Stripe fee https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee
net is what you get https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-net
So, I can't see the amount of the fee deducted, right?
I don't understand you question. If the payment is $10 and there's a $1 Stripe fee, then: amount = $10, fee = $1, net = $9
fee =3.4% + 0.3 USD ?
It depends on multiple factors. You can learn more about Stripe pricing here: https://stripe.com/pricing
OK,thanks
Happy to help 🙂
If I receive card in USD, but my default calculation currency is HKD, then amount, fee, net, will these be displayed in HKD or USD?
I think it would be in USD. But I recommend to quickly test this in test mode
Also you would get the exchange rate here: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-exchange_rate
OK
{
"id": "evt_3NJ9u3ILBklWVE7i0InszCpO",
"object": "event",
"api_version": "2022-11-15",
"created": 1686811412,
"data": {
"object": {
"id": "ch_3NJ9u3ILBklWVE7i0ubTDg0H",
"object": "charge",
"amount": 400,
"amount_captured": 400,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3NJ9u3ILBklWVE7i0QRznLnN",
"billing_details": {
"address": {
"city": null,
"country": "HK",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "panjonsen@foxmail.com",
"name": "214",
"phone": null
},
"calculated_statement_descriptor": "RENLAER.COM",
"captured": true,
"created": 1686811411,
"currency": "usd",
"customer": null,
"description": null,
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {
},
"invoice": null,
"livemode": false,
"metadata": {
},
"on_behalf_of": null,
"order": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 13,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": "pi_3NJ9u3ILBklWVE7i04piMnfw",
"payment_method": "pm_1NJ9u2ILBklWVE7iW9r9zf07",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"exp_month": 4,
"exp_year": 2024,
"fingerprint": "jrQuA4TNGgqIdcXT",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"network_token": {
"used": false
},
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTjZSWExJTEJrbFdWRTdpKJTmqqQGMgZRZdZSKZM6LBZG6JcLeeA3wOM4kOqkmfPA7WLwaf5F6mKfn2xsAtHOjJ0GRT3bHV9AnNxO",
"refunded": false,
"review": null,
"shipping": null,
"source": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_zBk1SmYl5P2Zaj",
"idempotency_key": "d8be8545-ff23-4127-91d4-03b49bc1b0cd"
},
"type": "charge.succeeded"
}
I first deal with the above parameters I got. Then go to request another interface to get the cost of this order? such as net and free
This is a Charge object, that contains this: "balance_transaction": "txn_3NJ9u3ILBklWVE7i0QRznLnN",
So yes you need to make a second API call to retrieve the balance transaction in order to see the fees
OK