feat(connector): [Stripe] Add support for refund webhooks (#1488)

This commit is contained in:
Sangamesh Kulkarni
2023-06-28 14:35:04 +05:30
committed by GitHub
parent 82545555d7
commit e6529b6a63
4 changed files with 64 additions and 40 deletions

View File

@ -41,21 +41,22 @@ pub enum WebhookFlow {
impl From<IncomingWebhookEvent> for WebhookFlow {
fn from(evt: IncomingWebhookEvent) -> Self {
match evt {
IncomingWebhookEvent::PaymentIntentFailure => Self::Payment,
IncomingWebhookEvent::PaymentIntentSuccess => Self::Payment,
IncomingWebhookEvent::PaymentIntentProcessing => Self::Payment,
IncomingWebhookEvent::PaymentActionRequired => Self::Payment,
IncomingWebhookEvent::PaymentIntentPartiallyFunded => Self::Payment,
IncomingWebhookEvent::PaymentIntentFailure
| IncomingWebhookEvent::PaymentIntentSuccess
| IncomingWebhookEvent::PaymentIntentProcessing
| IncomingWebhookEvent::PaymentActionRequired
| IncomingWebhookEvent::PaymentIntentPartiallyFunded => Self::Payment,
IncomingWebhookEvent::EventNotSupported => Self::ReturnResponse,
IncomingWebhookEvent::RefundSuccess => Self::Refund,
IncomingWebhookEvent::RefundFailure => Self::Refund,
IncomingWebhookEvent::DisputeOpened => Self::Dispute,
IncomingWebhookEvent::DisputeAccepted => Self::Dispute,
IncomingWebhookEvent::DisputeExpired => Self::Dispute,
IncomingWebhookEvent::DisputeCancelled => Self::Dispute,
IncomingWebhookEvent::DisputeChallenged => Self::Dispute,
IncomingWebhookEvent::DisputeWon => Self::Dispute,
IncomingWebhookEvent::DisputeLost => Self::Dispute,
IncomingWebhookEvent::RefundSuccess | IncomingWebhookEvent::RefundFailure => {
Self::Refund
}
IncomingWebhookEvent::DisputeOpened
| IncomingWebhookEvent::DisputeAccepted
| IncomingWebhookEvent::DisputeExpired
| IncomingWebhookEvent::DisputeCancelled
| IncomingWebhookEvent::DisputeChallenged
| IncomingWebhookEvent::DisputeWon
| IncomingWebhookEvent::DisputeLost => Self::Dispute,
IncomingWebhookEvent::EndpointVerification => Self::ReturnResponse,
IncomingWebhookEvent::SourceChargeable
| IncomingWebhookEvent::SourceTransactionCreated => Self::BankTransfer,