Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Samples/FlexMicroform/generate-capture-context-accept-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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));
Expand Down
6 changes: 3 additions & 3 deletions Samples/TokenManagement/Customer/create-customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]';
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);
Expand Down
6 changes: 3 additions & 3 deletions Samples/TokenManagement/Customer/update-customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]';
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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';
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down
Loading