@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.158 to 1.0.159
@@ -58,6 +58,6 @@ "use strict"; | ||
const { avs_result_code, credit_card_bin, credit_card_company, credit_card_number, cvv_result_code, } = paymentDetails; | ||
return { | ||
return new ns8_protect_models_1.CreditCard({ | ||
gateway, | ||
transactionType: ns8_protect_models_1.CreditCardTransactionType[kind.toUpperCase()], | ||
creditCardNumber: credit_card_number.split(' ').pop(), | ||
transactionType: kind ? ns8_protect_models_1.CreditCardTransactionType[kind.toUpperCase()] : undefined, | ||
creditCardNumber: credit_card_number ? credit_card_number.split(' ').pop() : undefined, | ||
creditCardCompany: credit_card_company, | ||
@@ -67,4 +67,5 @@ avsResultCode: avs_result_code, | ||
creditCardBin: credit_card_bin, | ||
}; | ||
}); | ||
}; | ||
exports.mapCreditCard = mapCreditCard; | ||
const mapTransactions = (transactionList) => (transactionList.map((transaction) => { | ||
@@ -74,6 +75,6 @@ const { id, amount, currency, kind, gateway, status, message, payment_details, processed_at, } = transaction; | ||
currency, | ||
platformId: id.toString(), | ||
platformId: id ? id.toString() : undefined, | ||
method: ns8_protect_models_1.TransactionMethod.CC, | ||
amount: parseFloat(amount), | ||
status: ns8_protect_models_1.TransactionStatus[status.toUpperCase()], | ||
status: status ? ns8_protect_models_1.TransactionStatus[status.toUpperCase()] : undefined, | ||
statusDetails: message, | ||
@@ -84,3 +85,3 @@ processedAt: new Date(processed_at), | ||
transactionPartial.method = ns8_protect_models_1.TransactionMethod.CC; | ||
transactionPartial.creditCard = new ns8_protect_models_1.CreditCard(mapCreditCard(payment_details, kind, gateway)); | ||
transactionPartial.creditCard = mapCreditCard(payment_details, kind, gateway); | ||
} | ||
@@ -103,2 +104,3 @@ else { | ||
})); | ||
exports.mapTransactions = mapTransactions; | ||
const makeTestClientDetails = () => ({ | ||
@@ -105,0 +107,0 @@ accept_language: 'en-us', |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.158", | ||
"version": "1.0.159", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77359
914