#kelvin_api

1 messages ยท Page 1 of 1 (latest)

thorn quiverBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1410470207905988628

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

golden remnant
#

hello! Thanks for waiting, what sometimes work, sometimes doesn't work?

thorn quiverBOT
limber prism
#

hi

#

yeah, i have some problem with display price on apple pay sheet

glass radish
#

Hi @limber prism I'm taking over this thread

limber prism
#

hi Jack

#

let me summary my issue facing:

  • we always pass value * 100 to apple pay
    e.g: 10.00 -> 1000; 10.50 -> 1050
    For non-decimal support currency it work (e.g JPY, KRW, VND), but for decimal currency ApplePay sheet show 1000 instead of 10
#

here is our config with ApplePay:

         merchantCountryCode: 'SG',
      currencyCode: currentCurrencyId ?? FALLBACK_CURRENCY,
      cartItems: [
        {
          label: 'Company',
          amount: price.toString(),
          paymentType: PlatformPay.PaymentType.Immediate,
        },
      ],
}
})
glass radish
#

Hi @limber prism the amount in cartItems is of type string, and stripe SDK will pass this value to Apple Pay paymentSheet for presentation. You don't need to multiple with 100 like what you do with Stripe amount.

limber prism
#

yeah, everything is fine until i try to go with JPY and decimal value, when i pass JPY as currency and value as 10.50 , it throws an error:

"error": {
    "stripeErrorCode": null,
    "declineCode": null,
    "localizedMessage": "Invalid in-app payment request. Search the iOS logs for `NSUnderlyingError` to get more information.",
    "message": "Invalid in-app payment request. Search the iOS logs for `NSUnderlyingError` to get more information.",
    "type": null,
    "code": "Failed"
  }
glass radish
#

I don't think JPY supports decimal

limber prism
#

yeah, so it come to a glitch that i need to if/else the list of non decimal support on FE (which base on Stripe document list) and it's not scalable / mantainable for us. Any other approach you might suggest?

limber prism
glass radish
limber prism
#

๐Ÿ‘

#

might i ask if there is anyway to archieve correct presentation of price accordingly with currency without if/else directly

glass radish
#

Are you talking about the Stripe amounts or the amounts to be presented on apple pay payment sheet?

limber prism
#

the amount to be present on Apple Pay sheet, i mean

glass radish
#

Ok, for amount passed via cartItems[amount], it'll be exactly the same value that you specify.

limber prism
#

yeah, but for JPY, KRW, VND, when people apply promo code (10%, 15%) the value will be decimal, we must convert them in BE instead? cannot do anything with Stripe SDK ?

glass radish
#

Will your customer apply the promo code through Stripe checkout? or your own UI?

limber prism
#

our own UI

glass radish
#

Ok, then you'll need to do the calculation and round the number

limber prism
#

thank Jack