feat(medusa, stripe, paypal): Add update payment session support to the abstract payment processor API (#4442)

* feat(medusa, stripe, paypal): Add update payment session support to the abstract payment processor API

* continue to add updatePaymentData

* feat: Add update payment data to paypal as well and add stripe tests

* fix stripe updatePaymentData returned object type

* fix tests

* Create three-ravens-raise.md

* fix paypal updatePayment data impl

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Adrien de PerettiandOliver Windall Juhl authored and GitHub committed 2023-07-10 15:59:19 +02:00
1 parent 1903217705
commit 4264302f21
9 files changed
+345 -138

No files matched your search

@@ -119,6 +119,16 @@ export interface PaymentProcessor {
getPaymentStatus(
paymentSessionData: Record<string, unknown>
): Promise<PaymentSessionStatus>
/**
* Update the session data for a payment session
*/
updatePaymentData(
sessionId: string,
data: Record<string, unknown>
): Promise<
PaymentProcessorError | PaymentProcessorSessionResponse["session_data"]
>
}
/**
@@ -195,6 +205,13 @@ export abstract class AbstractPaymentProcessor implements PaymentProcessor {
abstract updatePayment(
context: PaymentProcessorContext
): Promise<PaymentProcessorError | PaymentProcessorSessionResponse | void>
abstract updatePaymentData(
sessionId: string,
data: Record<string, unknown>
): Promise<
PaymentProcessorError | PaymentProcessorSessionResponse["session_data"]
>
}
/**