Aug 28, 2023
0
Level 1
stripe multi curency
Hi guys , i have a problem with stripe PaymentIntent always take my payments in euro. I have multi currency, and show good the dolars conversion on check out, but on stripe is reconvert in euro. is this Ok? This is my stripe getaway
$this->getPaymentIntent();
$payment = new Payment();
$payment->booking_id = $booking->id;
$payment->payment_gateway = $this->id;
$paymentMethodId = $request->get('paymentMethodId');
$data = [
'amount' => (float)$booking->pay_now,
'transactionId' => $booking->code . '.' . time(),
'description' => setting_item("site_title")." - #".$booking->id,
'token' => $request->stripeToken,
'currency' => setting_item('currency_main'),
'paymentMethod' => $paymentMethodId,
'returnUrl' => route('user.payment.stripe.confirm'),
'confirm' => true,
'metadata' => [
'booking_id' => $booking->id,
],
];
public function handlePurchaseData($data, $booking, $request)
{ $selectedCurrency = session('selected_currency'); // Moneda din sesiune
if (!$selectedCurrency) {
$selectedCurrency = setting_item('currency_main'); // Moneda implicită din setări
}
$data['currency'] = $selectedCurrency;
if (is_api()) {
$cardData = [
'lastName' => $request->input("card_name"),
'number' => $request->input("card_number"),
'expiryMonth' => $request->input("expiry_month"),
'expiryYear' => $request->input("expiry_year"),
'cvv' => $request->input("cvv"),
];
$data["card"] = $cardData;
} else {
$data['token'] = $request->input("token");
}
$data['description'] = setting_item("site_title") . " - #" . $booking->id;
return $data;
} public function handlePurchaseDataNormal($data, $payment) { $data['currency'] = setting_item('currency_main'); $data['token'] = \request()->input("token"); $data['description'] = setting_item("site_title")." - #".$payment->id; return $data; }
Please or to participate in this conversation.