fix: cart payment/order currency ignored the selected currency
createPayment() and recordOrder() hardcoded currency: 'RUB' regardless of LanguageService.currentCurrency() (app supports RUB/USD/EUR/AMD). Widened CartPaymentRequest.currency from a 'RUB' literal to string and use the actual selected currency in both calls. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -256,7 +256,7 @@ export class CartComponent implements OnDestroy {
|
|||||||
const orderId = this.generateOrderId();
|
const orderId = this.generateOrderId();
|
||||||
const paymentPayload = {
|
const paymentPayload = {
|
||||||
amount: Number(this.totalWithDelivery()),
|
amount: Number(this.totalWithDelivery()),
|
||||||
currency: 'RUB' as const,
|
currency: this.langService.currentCurrency(),
|
||||||
siteuserID: this.getPaymentUserId(),
|
siteuserID: this.getPaymentUserId(),
|
||||||
siteorderID: orderId,
|
siteorderID: orderId,
|
||||||
redirectUrl: '',
|
redirectUrl: '',
|
||||||
@@ -434,7 +434,7 @@ export class CartComponent implements OnDestroy {
|
|||||||
},
|
},
|
||||||
payment: {
|
payment: {
|
||||||
method: this.selectedPaymentMethod(),
|
method: this.selectedPaymentMethod(),
|
||||||
currency: 'RUB',
|
currency: this.langService.currentCurrency(),
|
||||||
},
|
},
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
error: (err) => console.error('Error recording order:', err),
|
error: (err) => console.error('Error recording order:', err),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export interface QrCreateResponse {
|
|||||||
|
|
||||||
export interface CartPaymentRequest {
|
export interface CartPaymentRequest {
|
||||||
amount: number;
|
amount: number;
|
||||||
currency: 'RUB';
|
currency: string;
|
||||||
siteuserID: string;
|
siteuserID: string;
|
||||||
siteorderID: string;
|
siteorderID: string;
|
||||||
redirectUrl: string;
|
redirectUrl: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user