mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix: ( telebirr ): fix payment status
This commit is contained in:
@@ -214,6 +214,7 @@ export class PaymentsService {
|
||||
if (refreshable && stale && intent.merchantOrderId && provider) {
|
||||
try {
|
||||
const status = await provider.queryStatus(intent.merchantOrderId);
|
||||
this.logger.log(status);
|
||||
await this.applyProviderStatus(intent.id, status);
|
||||
const refreshed = await this.prisma.paymentIntent.findUniqueOrThrow({
|
||||
where: { id: intent.id },
|
||||
@@ -234,7 +235,7 @@ export class PaymentsService {
|
||||
intentId: string,
|
||||
status: ProviderStatus,
|
||||
): Promise<void> {
|
||||
if (status.status === PaymentIntentStatus.SUCCEEDED) {
|
||||
if (status.rawResponse.biz_content.order_status === "PAY_SUCCESS") {
|
||||
await this.finalizePaymentSuccess({
|
||||
intentId,
|
||||
providerTxnId: status.providerTxnId,
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface ProviderStatus {
|
||||
providerTxnId?: string;
|
||||
failureCode?: string;
|
||||
failureMessage?: string;
|
||||
rawResponse: Record<string, unknown>;
|
||||
rawResponse: any;
|
||||
}
|
||||
|
||||
export interface PaymentProvider {
|
||||
|
||||
Reference in New Issue
Block a user