diff --git a/Data/ConfigurationWithMLE.js b/Data/ConfigurationWithMLE.js index 2e262f8..0a08d85 100644 --- a/Data/ConfigurationWithMLE.js +++ b/Data/ConfigurationWithMLE.js @@ -64,8 +64,18 @@ function MLEConfiguration1() { 'loggingLevel': 'debug', 'enableMasking': EnableMasking }, - 'useMLEGlobally': true, //globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK - 'mleKeyAlias':"CyberSource_SJC_US" //this is optional paramter, not required to set the parameter if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". + + //Set Request MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableRequestMLEForOptionalApisGlobally': true, //Enables request MLE globally for all APIs that have optional MLE support //same as older deprecated variable "useMLEGlobally" //APIs that has MLE Request mandatory is default has MLE support in SDK without any configuration but support with JWT auth type. + 'requestMleKeyAlias':"CyberSource_SJC_US", //this is optional parameter, not required to set the parameter if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". //same as older deprecated variable "mleKeyAlias" + + //Set Response MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableResponseMleGlobally': false, //Enables/Disable response MLE globally for all APIs that support MLE responses + 'responseMlePrivateKeyFilePath': "", //Path to the Response MLE private key file. Supported formats: .p12, .pfx, .pem, .key, .p8. Recommendation use encrypted private Key (password protection) for MLE response. + 'responseMlePrivateKeyFilePassword': "", //Password for the private key file (required for .p12/.pfx files or encrypted private keys). + 'responseMleKID': "" //This parameter is optional when responseMlePrivateKeyFilePath points to a CyberSource-generated P12 file. If not provided, the SDK will automatically fetch the Key ID from the P12 file. If provided, the SDK will use the user-provided value instead of the auto-fetched value. + //Required when using PEM format files (.pem, .key, .p8) or when providing responseMlePrivateKey object directly. + }; return configObj; @@ -99,12 +109,23 @@ function MLEConfiguration2() { 'loggingLevel': 'debug', 'enableMasking': EnableMasking }, - 'useMLEGlobally': true, //globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK + + //Set Request MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] 'mapToControlMLEonAPI':{ - "createPayment":false, //only createPayment function will have MLE=false i.e. (/pts/v2/payments POST API) out of all MLE supported APIs - "capturePayment":true //capturePayment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API), if it not in list of MLE supportedAPIs else it will already have MLE=true by global MLE parameter. + "createPayment":"false", //only createPayment function will have MLE=false i.e. (/pts/v2/payments POST API) out of all MLE supported APIs + "capturePayment":"true" //capturePayment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API), if it not in list of MLE supportedAPIs else it will already have MLE=true by global MLE parameter. }, - 'mleKeyAlias':"CyberSource_SJC_US" //this is optional paramter, not required to set the parameter/value if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". + + 'enableRequestMLEForOptionalApisGlobally': true, //Enables request MLE globally for all APIs that have optional MLE support //same as older deprecated variable "useMLEGlobally" + 'requestMleKeyAlias':"CyberSource_SJC_US", //this is optional parameter, not required to set the parameter if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". //same as older deprecated variable "mleKeyAlias" + + //Set Response MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableResponseMleGlobally': false, //Enables/Disable response MLE globally for all APIs that support MLE responses + 'responseMlePrivateKeyFilePath': "", //Path to the Response MLE private key file. Supported formats: .p12, .pfx, .pem, .key, .p8. Recommendation use encrypted private Key (password protection) for MLE response. + 'responseMlePrivateKeyFilePassword': "", //Password for the private key file (required for .p12/.pfx files or encrypted private keys). + 'responseMleKID': "" //This parameter is optional when responseMlePrivateKeyFilePath points to a CyberSource-generated P12 file. If not provided, the SDK will automatically fetch the Key ID from the P12 file. If provided, the SDK will use the user-provided value instead of the auto-fetched value. + //Required when using PEM format files (.pem, .key, .p8) or when providing responseMlePrivateKey object directly. + }; return configObj; @@ -138,12 +159,110 @@ function MLEConfiguration3() { 'loggingLevel': 'debug', 'enableMasking': EnableMasking }, - 'useMLEGlobally': false, //globally MLE will be disabled for all the APIs in SDK + + //Set Request MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] 'mapToControlMLEonAPI':{ - "createPayment":true, //only createPayment function will have MLE=true i.e. (/pts/v2/payments POST API) - "capturePayment":true //only capturePayment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API) + "createPayment":"true", //only createPayment function will have MLE=true i.e. (/pts/v2/payments POST API) + "capturePayment":"true" //only capturePayment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API) + }, + + 'enableRequestMLEForOptionalApisGlobally': false, //Disabled request MLE globally for all APIs that have optional MLE support //same as older deprecated variable "useMLEGlobally" + 'requestMleKeyAlias':"CyberSource_SJC_US", //this is optional parameter, not required to set the parameter if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". //same as older deprecated variable "mleKeyAlias" + + //Set Response MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableResponseMleGlobally': false, //Enables/Disable response MLE globally for all APIs that support MLE responses + 'responseMlePrivateKeyFilePath': "", //Path to the Response MLE private key file. Supported formats: .p12, .pfx, .pem, .key, .p8. Recommendation use encrypted private Key (password protection) for MLE response. + 'responseMlePrivateKeyFilePassword': "", //Password for the private key file (required for .p12/.pfx files or encrypted private keys). + 'responseMleKID': "" //This parameter is optional when responseMlePrivateKeyFilePath points to a CyberSource-generated P12 file. If not provided, the SDK will automatically fetch the Key ID from the P12 file. If provided, the SDK will use the user-provided value instead of the auto-fetched value. + //Required when using PEM format files (.pem, .key, .p8) or when providing responseMlePrivateKey object directly. + + }; + return configObj; + +} + +// Constructor for MLEConfigurationWithRequestAndResponseMLE1 +function MLEConfigurationWithRequestAndResponseMLE1() { + + var configObj = { + 'authenticationType': AuthenticationType, + 'runEnvironment': RunEnvironment, + + 'merchantID': 'agentic_mid_091225001', + + 'keyAlias': 'agentic_mid_091225001', + 'keyPass': 'Changeit@123', + 'keyFileName': 'agentic_mid_091225001', + 'keysDirectory': KeysDirectory, + + 'logConfiguration': { + 'enableLog': EnableLog, + 'logFileName': LogFileName, + 'logDirectory': LogDirectory, + 'logFileMaxSize': LogfileMaxSize, + 'loggingLevel': 'debug', + 'enableMasking': EnableMasking }, - 'mleKeyAlias':"CyberSource_SJC_US" //this is optional paramter, not required to set the parameter if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". + + //Set Request MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + // 'enableRequestMLEForOptionalApisGlobally': true, //Enables request MLE globally for all APIs that have optional MLE support //same as older deprecated variable "useMLEGlobally" //APIs that has MLE Request mandatory is default has MLE support in SDK without any configuration but support with JWT auth type. + 'useMLEGlobally': false, //deprecated variable, use 'enableRequestMLEForOptionalApisGlobally' instead + + //Set Response MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableResponseMleGlobally': true, //Enables response MLE globally for all APIs that support MLE responses + 'responseMlePrivateKeyFilePath': "Resource/agentic_mid_091225001_mle.p12", //Path to the Response MLE private key file. Supported formats: .p12, .pfx, .pem, .key, .p8. Recommendation use encrypted private Key (password protection) for MLE response. + 'responseMlePrivateKeyFilePassword': "Changeit@123", //Password for the private key file (required for .p12/.pfx files or encrypted private keys). + 'responseMleKID': "1757970970891045729358" //Optional since p12 is Cybs Generated. + //This parameter is optional when responseMlePrivateKeyFilePath points to a CyberSource-generated P12 file. If not provided, the SDK will automatically fetch the Key ID from the P12 file. If provided, the SDK will use the user-provided value instead of the auto-fetched value. + //Required when using PEM format files (.pem, .key, .p8) or when providing responseMlePrivateKey object directly. + + }; + return configObj; + +} + +// Constructor for MLEConfigurationWithRequestAndResponseMLE2 +function MLEConfigurationWithRequestAndResponseMLE2() { + + var configObj = { + 'authenticationType': AuthenticationType, + 'runEnvironment': RunEnvironment, + + 'merchantID': 'agentic_mid_091225001', + + 'keyAlias': 'agentic_mid_091225001', + 'keyPass': 'Changeit@123', + 'keyFileName': 'agentic_mid_091225001', + 'keysDirectory': KeysDirectory, + + 'logConfiguration': { + 'enableLog': EnableLog, + 'logFileName': LogFileName, + 'logDirectory': LogDirectory, + 'logFileMaxSize': LogfileMaxSize, + 'loggingLevel': 'debug', + 'enableMasking': EnableMasking + }, + + //Set Request MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableRequestMLEForOptionalApisGlobally': false, //Disable request MLE globally for all APIs that have optional MLE support //same as older deprecated variable "useMLEGlobally" //APIs that has MLE Request mandatory is default has MLE support in SDK without any configuration but support with JWT auth type. + + //Set Response MLE Settings in Merchant Configuration [Refer MLE.md on cybersource-rest-client-node github repo] + 'enableResponseMleGlobally': false, //Disable response MLE globally for all APIs that support MLE responses + + //Set Request & Response MLE Settings in Merchant Configuration through MAP for API control level [Refer MLE.md on cybersource-rest-client-node github repo] + 'mapToControlMLEonAPI':{ + "createPayment":"true::false", //only createPayment function will have Request MLE=true and Response MLE = false i.e. (/pts/v2/payments POST API) + "enrollCard":"true::true" //only enrollCard function will have Request MLE=true & Response MLE =true i.e. (/acp/v1/tokens POST API) + }, + + //since one of the API has Response MLE true, so below fields are required for Response MLE + 'responseMlePrivateKeyFilePath': "Resource/agentic_mid_091225001_new_generated_mle.p12", //Path to the Response MLE private key file. Supported formats: .p12, .pfx, .pem, .key, .p8. Recommendation use encrypted private Key (password protection) for MLE response. + 'responseMlePrivateKeyFilePassword': "Changeit@123", //Password for the private key file (required for .p12/.pfx files or encrypted private keys). + 'responseMleKID': "1764104507829324018353" //Optional since p12 is Cybs Generated. + //This parameter is optional when responseMlePrivateKeyFilePath points to a CyberSource-generated P12 file. If not provided, the SDK will automatically fetch the Key ID from the P12 file. If provided, the SDK will use the user-provided value instead of the auto-fetched value. + //Required when using PEM format files (.pem, .key, .p8) or when providing responseMlePrivateKey object directly. + }; return configObj; @@ -152,5 +271,7 @@ function MLEConfiguration3() { module.exports = { MLEConfiguration1, MLEConfiguration2, - MLEConfiguration3 + MLEConfiguration3, + MLEConfigurationWithRequestAndResponseMLE1, + MLEConfigurationWithRequestAndResponseMLE2 }; diff --git a/Resource/agentic_mid_091225001.p12 b/Resource/agentic_mid_091225001.p12 new file mode 100644 index 0000000..818ee46 Binary files /dev/null and b/Resource/agentic_mid_091225001.p12 differ diff --git a/Resource/agentic_mid_091225001_mle.p12 b/Resource/agentic_mid_091225001_mle.p12 new file mode 100644 index 0000000..8bdb84e Binary files /dev/null and b/Resource/agentic_mid_091225001_mle.p12 differ diff --git a/Resource/agentic_mid_091225001_new_generated_mle.p12 b/Resource/agentic_mid_091225001_new_generated_mle.p12 new file mode 100644 index 0000000..0fb5ed5 Binary files /dev/null and b/Resource/agentic_mid_091225001_new_generated_mle.p12 differ diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key.key b/Resource/agentic_mid_091225001_new_generated_mle_private_key.key new file mode 100644 index 0000000..14e1292 --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCMvaQOeFohpEaB +WW6TR29TnuTYpNuBwAUdJx0nUUcnToD4vNgokr9KYV9VADUL8HnZPisUlh4FGjbk +p6Q9HNm/ZAG7IYdiL1Gj1a318HIn9IfHSvxILCV0UktLrf45iNCblAbnuvP11Q4B +5V/Gg8R/HjHSykHRNM3K2FYlaQjP2hmV2rEcEgMCHPRX2PqsIOG+X05fNss8ZldS +ygnD0ZIJa7OI8MYIeUmUNfgwfRmbl5erNIZ4wWqbVuoxbWN3l3TVKv0i3mrSu8/d +3HYLO3cDEqCeaY4PPlTmYFprcRl21usi2WC7LidL523s5/wkih9FFFEmIPeF0qdF +JpPX6ZkZAgMBAAECggEARKHKGgBYu6UXeMZ65LlmMZn/sSIbpRdVpxTG48B/+UwQ +GrxEkOyW+hen3JSgSbU4RldJvN1DwGs7L6AMuHyUNv/21CGSmq/GmSV/krpxgMh/ +WhFYG33juejTrREpMzdjuyqhf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rXiHq +RZTY/futke3TdKOTzkNCNA== +-----END PRIVATE KEY----- diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key.p8 b/Resource/agentic_mid_091225001_new_generated_mle_private_key.p8 new file mode 100644 index 0000000..14e1292 --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key.p8 @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCMvaQOeFohpEaB +WW6TR29TnuTYpNuBwAUdJx0nUUcnToD4vNgokr9KYV9VADUL8HnZPisUlh4FGjbk +p6Q9HNm/ZAG7IYdiL1Gj1a318HIn9IfHSvxILCV0UktLrf45iNCblAbnuvP11Q4B +5V/Gg8R/HjHSykHRNM3K2FYlaQjP2hmV2rEcEgMCHPRX2PqsIOG+X05fNss8ZldS +ygnD0ZIJa7OI8MYIeUmUNfgwfRmbl5erNIZ4wWqbVuoxbWN3l3TVKv0i3mrSu8/d +3HYLO3cDEqCeaY4PPlTmYFprcRl21usi2WC7LidL523s5/wkih9FFFEmIPeF0qdF +JpPX6ZkZAgMBAAECggEARKHKGgBYu6UXeMZ65LlmMZn/sSIbpRdVpxTG48B/+UwQ +GrxEkOyW+hen3JSgSbU4RldJvN1DwGs7L6AMuHyUNv/21CGSmq/GmSV/krpxgMh/ +WhFYG33juejTrREpMzdjuyqhf2msxEnkbcpEPVNOhEreMxPMqs+cN3nt8Ipa8LiF +qIRwHvC/MpzTzU0TiyLn6EBI+PNsBGPwQVSCulI42JMg82EsR4iUxJBd8429x9Fw +8U6naGLJnVecSsQAAkSTZwPKQVSok3a4Lcu0n0HCDthwgq323QQWug8cy7y6qZYs +lUJvZEKNX/WZzRomK39JeDmSFDlykIA+lu1G1c32rQKBgQDvqJkxpIMhzuq6pPe2 +vntJkRo2NA25g9MoYk7HdObMSgg5HXnTm2TuV+smPjkwtdDEt4elUETGkRuzABT+ +nkP6stxpcmBCH4brk9uxZJq9LoHFuaByg9xABMJ6Tu47EOubxFYkbEvttk4Y9neA +p0SR08Jqhb64Me79wVo40lGWRwKBgQCWVl2iAyNVMZgMbHiAF3kMjHZbEYQzxi09 +VOh0V3r+81XZOaXXf3jh/bLw/qjcRNc3Bq3Lg5wtW96/gBmQMLisYrtgzqj/pX2c +nfvITcp9J+Bo/qvC+6/5tZXoCOPORVvYSP82lU90sCEPSKQfU3p+G16WMnRoiGwR +dnAu8NMlnwKBgGosPUIa6eVOb/skHoIdPS1IVV5yDSqE1kVr2A7RIXabzazP/Crd +Cwf0dz7IDjogMk8UJ8n7F50IqEbS4Ho0z1T/bFpiy3Y/1VwEcy3RriPluKRKKmTR +OgA6m5Xn5e7Q/jBR+P/F4pV7UHoKpsKeV+hq8hSTD/02UfSldjz6IB79AoGAQCsK ++i0GtsVdVegyotHiDBYkKojWedbb1nLYaVgxmoK4oOh3Pf0d1rAX4b+AycvkZItI +QTaiwcWV1P1Ta/UvzfyyaAatobi8Xc4c+wkhJbyQj6AsJiSRny7/ljO9MHzwT+gQ +bvbaHD9VTRW/X9Oc1BjQjaFpiHi6T9XS2mZWaZcCgYAlS9lziK6vycWqX/RSZRWl +JV/WDT3JXc6gKkNv7siAvqhMC6/FO4Ghz9UzA38MYWcdZqoMb49nKjTPSWf07rrq +fai8rALHk2M0MEhIh6HtPWpob6ppqqbR2Jt7wdn7eMIkuVlazAjsT6SE/nOrXiHq +RZTY/futke3TdKOTzkNCNA== +-----END PRIVATE KEY----- diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key.pem b/Resource/agentic_mid_091225001_new_generated_mle_private_key.pem new file mode 100644 index 0000000..c53503a --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key.pem @@ -0,0 +1,32 @@ +Bag Attributes + localKeyID: 01 + friendlyName: serialNumber=1764104507829324018353,CN=agentic_mid_091225001 +Key Attributes: +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgE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VOb/skHoIdPS1IVV5yDSqE1kVr2A7RIXabzazP/Crd +Cwf0dz7IDjogMk8UJ8n7F50IqEbS4Ho0z1T/bFpiy3Y/1VwEcy3RriPluKRKKmTR +OgA6m5Xn5e7Q/jBR+P/F4pV7UHoKpsKeV+hq8hSTD/02UfSldjz6IB79AoGAQCsK ++i0GtsVdVegyotHiDBYkKojWedbb1nLYaVgxmoK4oOh3Pf0d1rAX4b+AycvkZItI +QTaiwcWV1P1Ta/UvzfyyaAatobi8Xc4c+wkhJbyQj6AsJiSRny7/ljO9MHzwT+gQ +bvbaHD9VTRW/X9Oc1BjQjaFpiHi6T9XS2mZWaZcCgYAlS9lziK6vycWqX/RSZRWl +JV/WDT3JXc6gKkNv7siAvqhMC6/FO4Ghz9UzA38MYWcdZqoMb49nKjTPSWf07rrq +fai8rALHk2M0MEhIh6HtPWpob6ppqqbR2Jt7wdn7eMIkuVlazAjsT6SE/nOrXiHq +RZTY/futke3TdKOTzkNCNA== +-----END PRIVATE KEY----- diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.key b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.key new file mode 100644 index 0000000..ee09326 --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.key @@ -0,0 +1,34 @@ +Bag Attributes + localKeyID: 01 + friendlyName: serialNumber=1764104507829324018353,CN=agentic_mid_091225001 +Key Attributes: +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQY/OLJ/E9JbBiSUz0 +Pv8qzwICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEESL/NuBiLQEhmwN +gZbgimoEggTQMtrP+AL1SX+Zle+EpXuP55MKXDyk/FxTAiPgFieKuMUNnHignD0j +wf39Pd+7g9otFPldBTeI39kJ3DOuxRNHDHn0cGRwfqG96dL5/F43BtAQ34Om33/N +Nm4QxSHIbxX185cMO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zzh47UenJdYUf2Lh9VhHW+cwJyeOwE0k4rlg1JIsSbd10TcxxfYBvxnBF144+BtI +i9AwfuRAb980/OHe0IAdZxt0jbsMGw43tR5DU+T2KCQeQSmpuY60tCy++WLFqZM8 ++h77ipN9VOlSGwutQF01LNGENWqQhOKCGUuvZ7sbge2gkxPTqG4VW/WiB9Cxg7GG +TgMYSeUNxkFzX23cK7gGNLNEYjiiDfWoucKyD7h7JzExh2xyoSeymjX1iu3Vf55j +KKlUOd7CktnRW/iCMeRxwVuX02b2EXBX2puP9SxK6b2Uhdelk19uIPwzsSe0Cjkg +yi6WU04RyTdzN5i4vzVZWKzgESa7p/zW4zcH90aY8s4l9SVjhWBIxROvGFI6wl7Q +mleluItI1AmIBa2XS6aVnszJmTtGxWr+Xhgj8mZN0jOlZnSxzWDtmTk= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.p8 b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.p8 new file mode 100644 index 0000000..b429cb3 --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.p8 @@ -0,0 +1,30 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQl7ce1kY3m4lcIjqI +FvSLTQICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEI55kACIM3MiTYiH +y2N7iT4EggTQvGYQSNdpkT9Kt76u2hjOnpzCvcAr9EdrB8YZ+SNuRh942ntoppJZ +UHkYVaGgOWUSqPotnrxZvLaV2QFLTWxfCYy7rYgq9DtfIxaMtH62++u4MSOpFa5B +phsDuLFZsUUQKCIrGwVCu+tq5EHG/yH6iKRAJpIGAAmrYMZFjgOSWFTkpxN9hq6A +tf+v0D+MU1+xu7V0XNwtxPLQIlFBMTwlsxhxxf1NkFZBmAsOXM8e1GiQ44HNv1fC +hAPIymdtYVHE/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3SPjkd4xtZQGW8UX0wE/oZI +8Z3VW6QwrD/Z2FXcSwnusOZr9aklmxRo7JEAnV9cOnF2tf6mOhNmJk5j2CajCBIV +/e+LelsFt9hqOc7micvKZzsZWrv/mFUUHeZaqTaIhMGy679/7g7+69Ncr+XORxWJ +tqhJ59zMW5r52wEZfLF4gtYBoQTh6lDYRPLigLPx9s4/nsVhc+MSnWp3MfYfwfdK +Rw+8X/wCXYMvfOKzat/xs7Vdi9VAgoBXsgeFmTnSi/LcHJdLuPDE3HeEkoKvIh5O +rDFSBRV22vxCU5MDEicgCFFPuUvHZXDavAOv0yDGprV2YLS+xrmTVk0= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.pem b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.pem new file mode 100644 index 0000000..ee09326 --- /dev/null +++ b/Resource/agentic_mid_091225001_new_generated_mle_private_key_encrypted.pem @@ -0,0 +1,34 @@ +Bag Attributes + localKeyID: 01 + friendlyName: serialNumber=1764104507829324018353,CN=agentic_mid_091225001 +Key Attributes: +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQY/OLJ/E9JbBiSUz0 +Pv8qzwICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEESL/NuBiLQEhmwN +gZbgimoEggTQMtrP+AL1SX+Zle+EpXuP55MKXDyk/FxTAiPgFieKuMUNnHignD0j +wf39Pd+7g9otFPldBTeI39kJ3DOuxRNHDHn0cGRwfqG96dL5/F43BtAQ34Om33/N +Nm4QxSHIbxX185cMOdOTDrCKICxWx8C0nERm8q+JcUqxbJZvj2UqqGby3++UE5Ho +Wa8moKdIZumgNm9cGs2LKGwuZ9y7BmAUdYYLTl326m4WVGbRdpCBlOgGFyT9FK4w +379OlUYTudTSZ1xatGXHNX4o4LM8hy614fsQv/av4u50WNHf6DLI593p1vwH6P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kxPTqG4VW/WiB9Cxg7GG +TgMYSeUNxkFzX23cK7gGNLNEYjiiDfWoucKyD7h7JzExh2xyoSeymjX1iu3Vf55j +KKlUOd7CktnRW/iCMeRxwVuX02b2EXBX2puP9SxK6b2Uhdelk19uIPwzsSe0Cjkg +yi6WU04RyTdzN5i4vzVZWKzgESa7p/zW4zcH90aY8s4l9SVjhWBIxROvGFI6wl7Q +mleluItI1AmIBa2XS6aVnszJmTtGxWr+Xhgj8mZN0jOlZnSxzWDtmTk= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/Samples/MLEFeature/acp-api-example.js b/Samples/MLEFeature/acp-api-example.js new file mode 100644 index 0000000..c2b9505 --- /dev/null +++ b/Samples/MLEFeature/acp-api-example.js @@ -0,0 +1,159 @@ +'use strict'; + +var cybersourceRestApi = require('cybersource-rest-client'); +var path = require('path'); +var filePath = path.resolve('Data/ConfigurationWithMLE.js'); +var {MLEConfigurationWithRequestAndResponseMLE1,MLEConfigurationWithRequestAndResponseMLE2} = require(filePath); + +function acp_api_example(callback) { + try { + var configObject = new MLEConfigurationWithRequestAndResponseMLE2(); + // Change the config to MLEConfigurationWithRequestAndResponseMLE1 to for Global level Response MLE + var apiClient = new cybersourceRestApi.ApiClient(); + var requestObj = new cybersourceRestApi.AgenticCardEnrollmentRequest(); + + requestObj.clientCorrelationId = '3e1b7943-6567-4965-a32b-5aa93d057d35'; + var deviceInformation = new cybersourceRestApi.Acpv1tokensDeviceInformation(); + deviceInformation.userAgent = 'SampleUserAgent'; + deviceInformation.applicationName = 'My Magic App'; + deviceInformation.fingerprintSessionId = 'finSessionId'; + deviceInformation.country = 'US'; + var deviceInformationDeviceData = new cybersourceRestApi.Acpv1tokensDeviceInformationDeviceData(); + deviceInformationDeviceData.type = 'Mobile'; + deviceInformationDeviceData.manufacturer = 'Apple'; + deviceInformationDeviceData.brand = 'Apple'; + deviceInformationDeviceData.model = 'iPhone 16 Pro Max'; + deviceInformation.deviceData = deviceInformationDeviceData; + + deviceInformation.ipAddress = '192.168.0.100'; + deviceInformation.clientDeviceId = '000b2767814e4416999f4ee2b099491d2087'; + requestObj.deviceInformation = deviceInformation; + + var buyerInformation = new cybersourceRestApi.Acpv1tokensBuyerInformation(); + buyerInformation.language = 'en'; + buyerInformation.merchantCustomerId = '3e1b7943-6567-4965-a32b-5aa93d057d35'; + + var personalIdentification = new Array(); + var personalIdentification1 = new cybersourceRestApi.Acpv1tokensBuyerInformationPersonalIdentification(); + personalIdentification1.type = 'The identification type'; + personalIdentification1.id = '1'; + personalIdentification.push(personalIdentification1); + + buyerInformation.personalIdentification = personalIdentification; + + requestObj.buyerInformation = buyerInformation; + + var billTo = new cybersourceRestApi.Acpv1tokensBillTo(); + billTo.firstName = 'John'; + billTo.lastName = 'Doe'; + billTo.fullName = 'John Michael Doe'; + billTo.email = 'john.doe@example.com'; + billTo.countryCallingCode = '1'; + billTo.phoneNumber = '5551234567'; + billTo.numberIsVoiceOnly = false; + billTo.country = 'US'; + requestObj.billTo = billTo; + + var consumerIdentity = new cybersourceRestApi.Acpv1tokensConsumerIdentity(); + consumerIdentity.identityType = 'EMAIL_ADDRESS'; + consumerIdentity.identityValue = 'john.doe@example.com'; + consumerIdentity.identityProvider = 'PARTNER'; + consumerIdentity.identityProviderUrl = 'https://identity.partner.com'; + requestObj.consumerIdentity = consumerIdentity; + + var paymentInformation = new cybersourceRestApi.Acpv1tokensPaymentInformation(); + var paymentInformationCustomer = new cybersourceRestApi.Acpv1tokensPaymentInformationCustomer(); + paymentInformationCustomer.id = ''; + paymentInformation.customer = paymentInformationCustomer; + + var paymentInformationPaymentInstrument = new cybersourceRestApi.Acpv1tokensPaymentInformationPaymentInstrument(); + paymentInformationPaymentInstrument.id = ''; + paymentInformation.paymentInstrument = paymentInformationPaymentInstrument; + + var paymentInformationInstrumentIdentifier = new cybersourceRestApi.Acpv1tokensPaymentInformationInstrumentIdentifier(); + paymentInformationInstrumentIdentifier.id = '4044EB915C613A82E063AF598E0AE6EF'; + paymentInformation.instrumentIdentifier = paymentInformationInstrumentIdentifier; + + requestObj.paymentInformation = paymentInformation; + + var enrollmentReferenceData = new cybersourceRestApi.Acpv1tokensEnrollmentReferenceData(); + enrollmentReferenceData.enrollmentReferenceType = 'TOKEN_REFERENCE_ID'; + enrollmentReferenceData.enrollmentReferenceProvider = 'VTS'; + requestObj.enrollmentReferenceData = enrollmentReferenceData; + + + var assuranceData = new Array(); + var assuranceData1 = new cybersourceRestApi.Acpv1tokensAssuranceData(); + assuranceData1.verificationType = 'DEVICE'; + assuranceData1.verificationEntity = '10'; + + var verificationEvents = new Array(); + verificationEvents.push("01"); + assuranceData1.verificationEvents1 = verificationEvents; + + assuranceData1.verificationMethod = '02'; + assuranceData1.verificationResults = '01'; + assuranceData1.verificationTimestamp = '1735690745'; + var authenticationContext1 = new cybersourceRestApi.Acpv1tokensAuthenticationContext(); + authenticationContext1.action = 'AUTHENTICATE'; + assuranceData1.authenticationContext = authenticationContext1; + + var authenticatedIdentities1 = new cybersourceRestApi.Acpv1tokensAuthenticatedIdentities(); + authenticatedIdentities1.data = 'authenticatedData'; + authenticatedIdentities1.provider = 'VISA_PAYMENT_PASSKEY'; + authenticatedIdentities1.id = 'f48ac10b-58cc-4372-a567-0e02b2c3d489'; + assuranceData1.authenticatedIdentities = authenticatedIdentities1; + + assuranceData1.additionalData = ''; + assuranceData.push(assuranceData1); + + requestObj.assuranceData = assuranceData; + + + var consentData = new Array(); + var consentData1 = new cybersourceRestApi.Acpv1tokensConsentData(); + consentData1.id = '550e8400-e29b-41d4-a716-446655440000'; + consentData1.type = 'PERSONALIZATION'; + consentData1.source = 'CLIENT'; + consentData1.acceptedTime = '1719169800'; + consentData1.effectiveUntil = '1750705800'; + consentData.push(consentData1); + + requestObj.consentData = consentData; + + + var instance = new cybersourceRestApi.EnrollmentApi(configObject, apiClient); + + instance.enrollCard(requestObj, function (error, data, response) { + if(error) { + console.log('\nError : ' + error.message); + } + else if (data) { + console.log('\nData : ' + JSON.stringify(data)); + } + + console.log('\nResponse : ' + JSON.stringify(response)); + console.log('\nResponse Code of Enroll a card : ' + JSON.stringify(response['status'])); + + var status = response['status']; + write_log_audit(status); + callback(error, data, response); + }); + } + catch (error) { + console.log('\nException on calling the API : ' + error); + } +} + +function write_log_audit(status) { + var filename = path.basename(__filename).split(".")[0]; + console.log(`[Sample Code Testing] [${filename}] ${status}`); +} + +if (require.main === module) { + acp_api_example(function () { + console.log('\nEnrollCard end.'); + }); +} + +module.exports.acp_api_example = acp_api_example; \ No newline at end of file