#BruceWayne

1 messages · Page 1 of 1 (latest)

summer shadowBOT
alpine wing
#

hi

gentle edge
#

hello! i'm sorry but i don't understand, can you rephrase?

alpine wing
#

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?

gentle edge
#

can you share the checkout session id?

alpine wing
#

"id": "cs_test_a1WjcmibmpjbkdvVCxleH0X0ZG9K0hNcojo56mNTvNjlIdtVv6Zufzkih3",

#

this?

gentle edge
alpine wing
#

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?

gentle edge
#

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

alpine wing
#

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

gentle edge
#

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

alpine wing
#

I need to emphasize that I'm using test mode, not real mode.

#

Where can I check my default billing currency?

gentle edge
#

your account is a HK account, so the default settlement currency is HKD

alpine wing
#

How can I modify it to USD?

gentle edge
#

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

alpine wing
#

OK

#

Or, I add a USD bank account and set it as USD settlement, is that ok?

#

Is this a good idea?

gentle edge
#

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.

alpine wing
#

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?

gentle edge
#

you can try testing it out to see if it works

alpine wing
#

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?

gentle edge
#

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.

summer shadowBOT
alpine wing
#

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

lapis valve
#

Checkout Session is a one-time payment link, why do you want to create a new one if one already exists?

alpine wing
#

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

lapis valve
#

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

alpine wing
#

That would be great, thank you so much for your help

lapis valve
#

No problem! Happy to help 😄

alpine wing
#

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?

lapis valve
alpine wing
#

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",

lapis valve
alpine wing
#

So do I need to modify the API?

lapis valve
#

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',
  });
alpine wing
#

In this way, my dashboard-products will display a lot of temporary products, right?

lapis valve
#

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

alpine wing
#

Understood

#

Thanks for your help, thank you very much

lapis valve
#

No problem! Happy to help 😄

alpine wing
#

sorry

#

hi

alpine wing
#

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

lapis valve
alpine wing
#

req_gXeYUt2SEoIrEi

lapis valve
#

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

alpine wing
lapis valve
#

It's likely the Support isn't aware that your account country is HK

alpine wing
#

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.

Learn about Alipay, a digital wallet popular with customers from China.

#

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?

lapis valve
alpine wing
#

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.

lapis valve
#

you have a bank account in another currency

alpine wing
#

this

lapis valve
#

But it's not shown in the above page

alpine wing
#

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?

lapis valve
#

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

alpine wing
#

Oh, I can just create a US dollar bank account, but I can still set HKD as the billing currency? Sounds good

lapis valve
#

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

alpine wing
#

OK

#

i am contacting

lapis valve
#

👍

alpine wing
#

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”

lapis valve
#

Can you share the request ID (req_xxx) of the error?

alpine wing
#

when i created google pay he got error

lapis valve
#

google pay is part of card payment method types

#

if you have card type, it will include google pay and apple pay

alpine wing
#

req_gWBSVtyVkj3AKJ

lapis valve
alpine wing
#

We don't need WeChat Pay, we need Google Pay, did we get it wrong?

lapis valve
#

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

alpine wing
#

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

lapis valve
#

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

lapis valve
#

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?

alpine wing
#

NO

lapis valve
alpine wing
#

So can I disable Google Pay and Apple Pay? Is it okay to only display card payment?

summer shadowBOT
surreal cradle
#

Hi! I'm taking over this thread.

#

You want to disable Google/Apple Pay from your Checkout Session?

alpine wing
#

yes

surreal cradle
alpine wing
#

It can't be disabled in the API is it?

surreal cradle
#

For Checkout Session I don't see a way to disable Google/Apple Pay with the API.

alpine wing
#

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?

surreal cradle
alpine wing
#

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?

alpine wing
#

So, I can't see the amount of the fee deducted, right?

surreal cradle
#

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

alpine wing
#

fee =3.4% + 0.3 USD ?

surreal cradle
alpine wing
#

OK,thanks

surreal cradle
#

Happy to help 🙂

alpine wing
#

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?

surreal cradle
alpine wing
#

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

surreal cradle
#

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

alpine wing
#

OK