Skip to content

Commit

Permalink
Merge pull request #182 from commercetools/dasanorct/manage_pending_r…
Browse files Browse the repository at this point in the history
…esponses

feat(payments): manage pending responses
  • Loading branch information
dasanorct authored Aug 2, 2024
2 parents 6739a4f + d996a51 commit 41d7256
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions enabler/src/payment-enabler/adyen-payment-enabler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export class AdyenPaymentEnabler implements PaymentEnabler {
});
component.handleAction(data.action);
} else {
if (data.resultCode === "Authorised") {
if (
data.resultCode === "Authorised" ||
data.resultCode === "Pending"
) {
component.setStatus("success");
options.onComplete &&
options.onComplete({ isSuccess: true, paymentReference });
Expand Down Expand Up @@ -140,7 +143,10 @@ export class AdyenPaymentEnabler implements PaymentEnabler {
body: JSON.stringify(requestData),
});
const data = await response.json();
if (data.resultCode === "Authorised") {
if (
data.resultCode === "Authorised" ||
data.resultCode === "Pending"
) {
component.setStatus("success");
options.onComplete &&
options.onComplete({ isSuccess: true, paymentReference });
Expand Down

0 comments on commit 41d7256

Please sign in to comment.