From d7805aedc4ab736dd86c5c6dc2118008216b6c1f Mon Sep 17 00:00:00 2001 From: "Kumar,Monu" Date: Wed, 5 Nov 2025 11:09:45 +0530 Subject: [PATCH 1/5] parsing jwt response via utility --- .../generate-capture-context-accept-card.js | 7 +++++++ ...rate-capture-context-for-click-to-pay-dropin-ui.js | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Samples/FlexMicroform/generate-capture-context-accept-card.js b/Samples/FlexMicroform/generate-capture-context-accept-card.js index 26ff3ac..b09b86d 100644 --- a/Samples/FlexMicroform/generate-capture-context-accept-card.js +++ b/Samples/FlexMicroform/generate-capture-context-accept-card.js @@ -49,6 +49,13 @@ function generate_capture_context_accept_card(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + if (err) { + console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); + } else { + console.log('\nParsed Capture Context : ' + JSON.stringify(result)); + } + }); } console.log('\nResponse : ' + JSON.stringify(response)); diff --git a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js index 13fd4e7..c9ab7f5 100644 --- a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js +++ b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js @@ -74,14 +74,21 @@ function generate_capture_context_for_click_to_pay_dropin_ui(callback) { instance.generateUnifiedCheckoutCaptureContext(requestObj, function (error, data, response) { if (error) { - console.log('\nError : ' + JSON.stringify(error)); + console.log('\nError : ' + error); } else if (data) { console.log('\nData : ' + JSON.stringify(data)); + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + if (err) { + console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); + } else { + console.log('\nParsed Capture Context : ' + JSON.stringify(result)); + } + }); } console.log('\nResponse : ' + JSON.stringify(response)); - console.log('\nResponse Code of Process a Payment : ' + JSON.stringify(response['status'])); + // console.log('\nResponse Code of Process a Payment : ' + JSON.stringify(response['status'])); callback(error, data, response); }); } From 860694b68c6a509e1975d92132bf7f9b60f0190f Mon Sep 17 00:00:00 2001 From: "Kumar,Monu" Date: Wed, 5 Nov 2025 11:14:33 +0530 Subject: [PATCH 2/5] minor fix --- .../generate-capture-context-for-click-to-pay-dropin-ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js index c9ab7f5..dd0e2c6 100644 --- a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js +++ b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js @@ -74,7 +74,7 @@ function generate_capture_context_for_click_to_pay_dropin_ui(callback) { instance.generateUnifiedCheckoutCaptureContext(requestObj, function (error, data, response) { if (error) { - console.log('\nError : ' + error); + console.log('\nError : ' + JSON.stringify(error)); } else if (data) { console.log('\nData : ' + JSON.stringify(data)); @@ -88,7 +88,7 @@ function generate_capture_context_for_click_to_pay_dropin_ui(callback) { } console.log('\nResponse : ' + JSON.stringify(response)); - // console.log('\nResponse Code of Process a Payment : ' + JSON.stringify(response['status'])); + console.log('\nResponse Code of Process a Payment : ' + JSON.stringify(response['status'])); callback(error, data, response); }); } From 90f812ad96147fb3bd8c4245fdef7a0cd499c86f Mon Sep 17 00:00:00 2001 From: "Kumar,Monu" Date: Wed, 5 Nov 2025 11:22:40 +0530 Subject: [PATCH 3/5] parsing jwt response via utility for remaining samples --- .../FlexMicroform/generate-capture-context-accept-check.js | 7 +++++++ ...ed-checkout-capture-context-passing-billing-shipping.js | 7 +++++++ .../generate-unified-checkout-capture-context.js | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/Samples/FlexMicroform/generate-capture-context-accept-check.js b/Samples/FlexMicroform/generate-capture-context-accept-check.js index 868f095..02c2eb7 100644 --- a/Samples/FlexMicroform/generate-capture-context-accept-check.js +++ b/Samples/FlexMicroform/generate-capture-context-accept-check.js @@ -30,6 +30,13 @@ function generate_capture_context_accept_check(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + if (err) { + console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); + } else { + console.log('\nParsed Capture Context : ' + JSON.stringify(result)); + } + }); } console.log('\nResponse : ' + JSON.stringify(response)); diff --git a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js index 17af14e..1c84206 100644 --- a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js +++ b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js @@ -136,6 +136,13 @@ function generate_unified_checkout_capture_context_passing_billing_shipping(call } else if (data) { console.log('\nData : ' + JSON.stringify(data)); + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + if (err) { + console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); + } else { + console.log('\nParsed Capture Context : ' + JSON.stringify(result)); + } + }); } console.log('\nResponse : ' + JSON.stringify(response)); diff --git a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js index 6520227..aa390db 100644 --- a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js +++ b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js @@ -83,6 +83,13 @@ function generate_unified_checkout_capture_context(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + if (err) { + console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); + } else { + console.log('\nParsed Capture Context : ' + JSON.stringify(result)); + } + }); } console.log('\nResponse : ' + JSON.stringify(response)); From 99d0f501a20973cfd63feb490812616956966039 Mon Sep 17 00:00:00 2001 From: "Goel, Aastvik" Date: Mon, 24 Nov 2025 15:46:22 +0530 Subject: [PATCH 4/5] updated model names for TMS --- Samples/TokenManagement/Customer/create-customer.js | 6 +++--- Samples/TokenManagement/Customer/update-customer.js | 6 +++--- .../update-customers-default-payment-instrument.js | 2 +- .../update-customers-default-shipping-address.js | 2 +- ...reate-customer-default-payment-instrument-card.js | 6 +++--- ...e-customer-non-default-payment-instrument-card.js | 6 +++--- ...reate-customer-payment-instrument-bank-account.js | 12 ++++++------ ...eate-customer-payment-instrument-pinless-debit.js | 6 +++--- .../create-customer-default-shipping-address.js | 2 +- .../create-customer-non-default-shipping-address.js | 2 +- .../create-payment-instrument-bank-account.js | 12 ++++++------ .../create-payment-instrument-card.js | 6 +++--- .../create-payment-instrument-pinless-debit.js | 6 +++--- .../PaymentInstrument/update-payment-instrument.js | 6 +++--- package.json | 2 +- 15 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Samples/TokenManagement/Customer/create-customer.js b/Samples/TokenManagement/Customer/create-customer.js index 40d0a00..65edce4 100644 --- a/Samples/TokenManagement/Customer/create-customer.js +++ b/Samples/TokenManagement/Customer/create-customer.js @@ -11,18 +11,18 @@ function create_customer(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostCustomerRequest(); - var buyerInformation = new cybersourceRestApi.Tmsv2customersBuyerInformation(); + var buyerInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerBuyerInformation(); buyerInformation.merchantCustomerID = 'Your customer identifier'; buyerInformation.email = 'test@cybs.com'; requestObj.buyerInformation = buyerInformation; - var clientReferenceInformation = new cybersourceRestApi.Tmsv2customersClientReferenceInformation(); + var clientReferenceInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerClientReferenceInformation(); clientReferenceInformation.code = 'TC50171_3'; requestObj.clientReferenceInformation = clientReferenceInformation; var merchantDefinedInformation = new Array(); - var merchantDefinedInformation1 = new cybersourceRestApi.Tmsv2customersMerchantDefinedInformation(); + var merchantDefinedInformation1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerMerchantDefinedInformation(); merchantDefinedInformation1.name = 'data1'; merchantDefinedInformation1.value = 'Your customer data'; merchantDefinedInformation.push(merchantDefinedInformation1); diff --git a/Samples/TokenManagement/Customer/update-customer.js b/Samples/TokenManagement/Customer/update-customer.js index d11d19f..73b4a9f 100644 --- a/Samples/TokenManagement/Customer/update-customer.js +++ b/Samples/TokenManagement/Customer/update-customer.js @@ -12,18 +12,18 @@ function update_customer(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PatchCustomerRequest(); - var buyerInformation = new cybersourceRestApi.Tmsv2customersBuyerInformation(); + var buyerInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerBuyerInformation(); buyerInformation.merchantCustomerID = 'Your customer identifier'; buyerInformation.email = 'test@cybs.com'; requestObj.buyerInformation = buyerInformation; - var clientReferenceInformation = new cybersourceRestApi.Tmsv2customersClientReferenceInformation(); + var clientReferenceInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerClientReferenceInformation(); clientReferenceInformation.code = 'TC50171_3'; requestObj.clientReferenceInformation = clientReferenceInformation; var merchantDefinedInformation = new Array(); - var merchantDefinedInformation1 = new cybersourceRestApi.Tmsv2customersMerchantDefinedInformation(); + var merchantDefinedInformation1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerMerchantDefinedInformation(); merchantDefinedInformation1.name = 'data1'; merchantDefinedInformation1.value = 'Your customer data'; merchantDefinedInformation.push(merchantDefinedInformation1); diff --git a/Samples/TokenManagement/Customer/update-customers-default-payment-instrument.js b/Samples/TokenManagement/Customer/update-customers-default-payment-instrument.js index 9a6c07a..a754a10 100644 --- a/Samples/TokenManagement/Customer/update-customers-default-payment-instrument.js +++ b/Samples/TokenManagement/Customer/update-customers-default-payment-instrument.js @@ -13,7 +13,7 @@ function update_customers_default_payment_instrument(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PatchCustomerRequest(); - var defaultPaymentInstrument = new cybersourceRestApi.Tmsv2customersDefaultPaymentInstrument(); + var defaultPaymentInstrument = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerDefaultPaymentInstrument(); defaultPaymentInstrument.id = 'AB6A54B982A6FCB6E05341588E0A3935'; requestObj.defaultPaymentInstrument = defaultPaymentInstrument; diff --git a/Samples/TokenManagement/Customer/update-customers-default-shipping-address.js b/Samples/TokenManagement/Customer/update-customers-default-shipping-address.js index ae842cb..6f2ce69 100644 --- a/Samples/TokenManagement/Customer/update-customers-default-shipping-address.js +++ b/Samples/TokenManagement/Customer/update-customers-default-shipping-address.js @@ -12,7 +12,7 @@ function update_customers_default_shipping_address(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PatchCustomerRequest(); - var defaultShippingAddress = new cybersourceRestApi.Tmsv2customersDefaultShippingAddress(); + var defaultShippingAddress = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerDefaultShippingAddress(); defaultShippingAddress.id = 'AB6A54B97C00FCB6E05341588E0A3935'; requestObj.defaultShippingAddress = defaultShippingAddress; diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js index 19fb19c..2769caf 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js @@ -13,13 +13,13 @@ function create_customer_default_payment_instrument_card(callback) { var requestObj = new cybersourceRestApi.PostCustomerPaymentInstrumentRequest(); requestObj._default = true; - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = '001'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -32,7 +32,7 @@ function create_customer_default_payment_instrument_card(callback) { billTo.phoneNumber = '4158880000'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js index 6f9d725..250ef89 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js @@ -13,13 +13,13 @@ function create_customer_non_default_payment_instrument_card(callback) { var requestObj = new cybersourceRestApi.PostCustomerPaymentInstrumentRequest(); requestObj._default = false; - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = '001'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -32,7 +32,7 @@ function create_customer_non_default_payment_instrument_card(callback) { billTo.phoneNumber = '4158880000'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js index d9298be..6fe86b0 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js @@ -12,20 +12,20 @@ function create_customer_payment_instrument_bank_account(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostCustomerPaymentInstrumentRequest(); - var bankAccount = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBankAccount(); + var bankAccount = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount(); bankAccount.type = 'savings'; requestObj.bankAccount = bankAccount; - var buyerInformation = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformation(); + var buyerInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation(); buyerInformation.companyTaxID = '12345'; buyerInformation.currency = 'USD'; buyerInformation.dateOfBirth = '2000-12-13'; var personalIdentification = new Array(); - var personalIdentification1 = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformationPersonalIdentification(); + var personalIdentification1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformationPersonalIdentification(); personalIdentification1.id = '57684432111321'; personalIdentification1.type = 'driver license'; - var issuedBy1 = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformationIssuedBy(); + var issuedBy1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformationIssuedBy(); issuedBy1.administrativeArea = 'CA'; personalIdentification1.issuedBy = issuedBy1; @@ -35,7 +35,7 @@ function create_customer_payment_instrument_bank_account(callback) { requestObj.buyerInformation = buyerInformation; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -55,7 +55,7 @@ function create_customer_payment_instrument_bank_account(callback) { requestObj.processingInformation = processingInformation; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = 'A7A91A2CA872B272E05340588D0A0699'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js index d76eaa9..0d363f0 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js @@ -12,7 +12,7 @@ function create_customer_payment_instrument_pinless_debit(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostCustomerPaymentInstrumentRequest(); - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = '001'; @@ -22,7 +22,7 @@ function create_customer_payment_instrument_pinless_debit(callback) { card.useAs = 'pinless debit'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -35,7 +35,7 @@ function create_customer_payment_instrument_pinless_debit(callback) { billTo.phoneNumber = '4158880000'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js b/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js index 57625f0..bebce4f 100644 --- a/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js +++ b/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js @@ -13,7 +13,7 @@ function create_customer_default_shipping_address(callback) { var requestObj = new cybersourceRestApi.PostCustomerShippingAddressRequest(); requestObj._default = true; - var shipTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultShippingAddressShipTo(); + var shipTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultShippingAddressShipTo(); shipTo.firstName = 'John'; shipTo.lastName = 'Doe'; shipTo.company = 'CyberSource'; diff --git a/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js b/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js index bf22f9b..461de06 100644 --- a/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js +++ b/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js @@ -13,7 +13,7 @@ function create_customer_non_default_shipping_address(callback) { var requestObj = new cybersourceRestApi.PostCustomerShippingAddressRequest(); requestObj._default = false; - var shipTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultShippingAddressShipTo(); + var shipTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultShippingAddressShipTo(); shipTo.firstName = 'John'; shipTo.lastName = 'Doe'; shipTo.company = 'CyberSource'; diff --git a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-bank-account.js b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-bank-account.js index 3d18189..017b69a 100644 --- a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-bank-account.js +++ b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-bank-account.js @@ -13,20 +13,20 @@ function create_payment_instrument_bank_account(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostPaymentInstrumentRequest(); - var bankAccount = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBankAccount(); + var bankAccount = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount(); bankAccount.type = 'savings'; requestObj.bankAccount = bankAccount; - var buyerInformation = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformation(); + var buyerInformation = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation(); buyerInformation.companyTaxID = '12345'; buyerInformation.currency = 'USD'; buyerInformation.dateOfBirth = '2000-12-13'; var personalIdentification = new Array(); - var personalIdentification1 = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformationPersonalIdentification(); + var personalIdentification1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformationPersonalIdentification(); personalIdentification1.id = '57684432111321'; personalIdentification1.type = 'driver license'; - var issuedBy1 = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBuyerInformationIssuedBy(); + var issuedBy1 = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformationIssuedBy(); issuedBy1.administrativeArea = 'CA'; personalIdentification1.issuedBy = issuedBy1; @@ -36,7 +36,7 @@ function create_payment_instrument_bank_account(callback) { requestObj.buyerInformation = buyerInformation; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -56,7 +56,7 @@ function create_payment_instrument_bank_account(callback) { requestObj.processingInformation = processingInformation; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = 'A7A91A2CA872B272E05340588D0A0699'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js index dbdfdbe..a4339ed 100644 --- a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js +++ b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js @@ -13,13 +13,13 @@ function create_payment_instrument_card(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostPaymentInstrumentRequest(); - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = 'visa'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -32,7 +32,7 @@ function create_payment_instrument_card(callback) { billTo.phoneNumber = '4158880000'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js index 2c7dab1..8bb2995 100644 --- a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js +++ b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js @@ -13,7 +13,7 @@ function create_payment_instrument_pinless_debit(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PostPaymentInstrumentRequest(); - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = 'visa'; @@ -23,7 +23,7 @@ function create_payment_instrument_pinless_debit(callback) { card.useAs = 'pinless debit'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'John'; billTo.lastName = 'Doe'; billTo.company = 'CyberSource'; @@ -36,7 +36,7 @@ function create_payment_instrument_pinless_debit(callback) { billTo.phoneNumber = '4158880000'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/Samples/TokenManagement/PaymentInstrument/update-payment-instrument.js b/Samples/TokenManagement/PaymentInstrument/update-payment-instrument.js index b4a6b93..4906711 100644 --- a/Samples/TokenManagement/PaymentInstrument/update-payment-instrument.js +++ b/Samples/TokenManagement/PaymentInstrument/update-payment-instrument.js @@ -14,13 +14,13 @@ function update_payment_instrument(callback) { var apiClient = new cybersourceRestApi.ApiClient(); var requestObj = new cybersourceRestApi.PatchPaymentInstrumentRequest(); - var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var card = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard(); card.expirationMonth = '12'; card.expirationYear = '2031'; card.type = 'visa'; requestObj.card = card; - var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); + var billTo = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo(); billTo.firstName = 'Jack'; billTo.lastName = 'Smith'; billTo.company = 'CyberSource'; @@ -33,7 +33,7 @@ function update_payment_instrument(callback) { billTo.phoneNumber = '4158888674'; requestObj.billTo = billTo; - var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); + var instrumentIdentifier = new cybersourceRestApi.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); instrumentIdentifier.id = '7010000000016241111'; requestObj.instrumentIdentifier = instrumentIdentifier; diff --git a/package.json b/package.json index 580f1e8..142f59b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "author": "developer@cybersource.com", "license": "MIT", "dependencies": { - "cybersource-rest-client": "0.0.72", + "cybersource-rest-client": "0.0.74", "eslint": "^5.9.0", "jwk-to-pem": "^2.0.0", "node-forge": "^1.2.1" From f880216df921f267dfaafb73dad080559cb358b8 Mon Sep 17 00:00:00 2001 From: "Goel, Aastvik" Date: Thu, 27 Nov 2025 17:29:09 +0530 Subject: [PATCH 5/5] changed sample code to match new function signature --- Samples/FlexMicroform/generate-capture-context-accept-card.js | 2 +- Samples/FlexMicroform/generate-capture-context-accept-check.js | 2 +- .../generate-capture-context-for-click-to-pay-dropin-ui.js | 2 +- ...unified-checkout-capture-context-passing-billing-shipping.js | 2 +- .../generate-unified-checkout-capture-context.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Samples/FlexMicroform/generate-capture-context-accept-card.js b/Samples/FlexMicroform/generate-capture-context-accept-card.js index b09b86d..8c1b78c 100644 --- a/Samples/FlexMicroform/generate-capture-context-accept-card.js +++ b/Samples/FlexMicroform/generate-capture-context-accept-card.js @@ -49,7 +49,7 @@ function generate_capture_context_accept_card(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); - cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, function (err, result) { if (err) { console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); } else { diff --git a/Samples/FlexMicroform/generate-capture-context-accept-check.js b/Samples/FlexMicroform/generate-capture-context-accept-check.js index 02c2eb7..80f0936 100644 --- a/Samples/FlexMicroform/generate-capture-context-accept-check.js +++ b/Samples/FlexMicroform/generate-capture-context-accept-check.js @@ -30,7 +30,7 @@ function generate_capture_context_accept_check(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); - cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, function (err, result) { if (err) { console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); } else { diff --git a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js index dd0e2c6..2721357 100644 --- a/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js +++ b/Samples/UnifiedCheckout/generate-capture-context-for-click-to-pay-dropin-ui.js @@ -78,7 +78,7 @@ function generate_capture_context_for_click_to_pay_dropin_ui(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); - cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, function (err, result) { if (err) { console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); } else { diff --git a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js index 1c84206..6e0c5dd 100644 --- a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js +++ b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context-passing-billing-shipping.js @@ -136,7 +136,7 @@ function generate_unified_checkout_capture_context_passing_billing_shipping(call } else if (data) { console.log('\nData : ' + JSON.stringify(data)); - cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, function (err, result) { if (err) { console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); } else { diff --git a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js index aa390db..8b9ba32 100644 --- a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js +++ b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js @@ -83,7 +83,7 @@ function generate_unified_checkout_capture_context(callback) { } else if (data) { console.log('\nData : ' + JSON.stringify(data)); - cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, true, function (err, result) { + cybersourceRestApi.CaptureContextParsingUtility.parseCaptureContextResponse(data, apiClient.merchantConfig, function (err, result) { if (err) { console.log('\nError in Capture Context Parsing : ' + JSON.stringify(err)); } else {