zac1987
zac1987

Reputation: 2777

Stripe multiple payment method with difference currency

I am using Stripe payment gateway. Let's say product price is USD2000. Currently my code output 3 payment methods with 1 currency only :

Card : MYR2000

FPX : MYR2000

Alipay : MYR2000

Screenshot here : enter image description here

Code :

$session = \Stripe\Checkout\Session::create([
    'payment_method_types' => ['card', 'fpx','alipay'],
    'line_items' => [[
        'price_data' => [
            'currency' => 'myr', 'unit_amount' => 8000.00,
            'currency' => 'usd', 'unit_amount' => 2000.00,
            'currency' => 'cny', 'unit_amount' => 4000.00,
            'product_data' => [
                'name' => $productName,
                'metadata' => [
                    'pro_id' => $productID
                ]
            ],
        ],
        'quantity' => 1,
        'description' => $productName,
    ]],
    'mode' => 'payment',
    'success_url' => STRIPE_SUCCESS_URL.'?session_id={CHECKOUT_SESSION_ID}',
    'cancel_url' => STRIPE_CANCEL_URL,
]);

I want to have the 3 payment methods with 3 difference currency as following :

Card : USD2000

FPX : MYR8000

Alipay : CNY4000

How to do that?

Upvotes: 0

Views: 727

Answers (1)

floatingLomas
floatingLomas

Reputation: 8747

It's not possible to do that - you can only set one currency for the Checkout Session.

Upvotes: 1

Related Questions