Skip to content

Commit

Permalink
fix: update credit card parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kiremitrov123 committed May 11, 2023
1 parent 66bd0f1 commit 56c539e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/inplayer.checkout.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ export const updateOrder: UpdateOrder = async ({ order, couponCode }) => {
};

export const directPostCardPayment = async (cardPaymentPayload: CardPaymentData, order: Order) => {
const number = parseInt(String(cardPaymentPayload.cardNumber).replace(/\s/g, ''), 10);

const payload = {
number: cardPaymentPayload.cardNumber,
number,
cardName: cardPaymentPayload.cardholderName,
expMonth: cardPaymentPayload.cardExpMonth || '',
expYear: cardPaymentPayload.cardExpYear || '',
Expand All @@ -164,7 +166,6 @@ export const directPostCardPayment = async (cardPaymentPayload: CardPaymentData,

try {
if (isSVODOffer(order)) {
// @ts-ignore
await InPlayer.Subscription.createSubscription(payload);
} else {
await InPlayer.Payment.createPayment(payload);
Expand Down

0 comments on commit 56c539e

Please sign in to comment.