cybersource_rest_client 0.0.83 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +46 -27
  3. data/lib/AuthenticationSDK/core/MerchantConfig.rb +82 -48
  4. data/lib/AuthenticationSDK/util/Cache.rb +7 -4
  5. data/lib/AuthenticationSDK/util/Constants.rb +6 -0
  6. data/lib/AuthenticationSDK/util/MLEUtility.rb +9 -0
  7. data/lib/cybersource_rest_client/api/batches_api.rb +1 -1
  8. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +14 -22
  9. data/lib/cybersource_rest_client/api/credentials_api.rb +104 -0
  10. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +3 -3
  11. data/lib/cybersource_rest_client/api/enrollment_api.rb +2 -2
  12. data/lib/cybersource_rest_client/api/instructions_api.rb +10 -10
  13. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +3 -3
  14. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +20 -28
  15. data/lib/cybersource_rest_client/api/network_tokens_api.rb +654 -0
  16. data/lib/cybersource_rest_client/api/plans_api.rb +1 -1
  17. data/lib/cybersource_rest_client/api/subscriptions_api.rb +183 -1
  18. data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +1 -1
  19. data/lib/cybersource_rest_client/api_client.rb +4 -0
  20. data/lib/cybersource_rest_client/models/account_validations_request.rb +15 -5
  21. data/lib/cybersource_rest_client/models/acpv1instructions_decline_threshold.rb +1 -1
  22. data/lib/cybersource_rest_client/models/acpv1instructions_mandates.rb +1 -1
  23. data/lib/cybersource_rest_client/models/acpv1instructions_recurring_payment_information.rb +1 -1
  24. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information.rb +1 -1
  25. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information_payment_instrument.rb +1 -1
  26. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_amount_detail.rb +1 -1
  27. data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge.rb +369 -0
  28. data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge_encryption_jwk.rb +336 -0
  29. data/lib/cybersource_rest_client/models/acpv1tokens_assurance_data.rb +7 -7
  30. data/lib/cybersource_rest_client/models/acpv1tokens_authenticated_identities.rb +1 -1
  31. data/lib/cybersource_rest_client/models/acpv1tokens_authentication_context.rb +1 -1
  32. data/lib/cybersource_rest_client/models/acpv1tokens_bill_to.rb +1 -1
  33. data/lib/cybersource_rest_client/models/acpv1tokens_buyer_information.rb +1 -1
  34. data/lib/cybersource_rest_client/models/acpv1tokens_consumer_identity.rb +1 -1
  35. data/lib/cybersource_rest_client/models/acpv1tokens_device_information.rb +1 -1
  36. data/lib/cybersource_rest_client/models/acpv1tokens_enrollment_reference_data.rb +1 -1
  37. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information.rb +1 -1
  38. data/lib/cybersource_rest_client/models/auth_reversal_request.rb +11 -1
  39. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information.rb +32 -6
  40. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank.rb +1 -1
  41. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank_account.rb +1 -1
  42. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_customer.rb +196 -0
  43. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_instrument_identifier.rb +196 -0
  44. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_payment_instrument.rb +196 -0
  45. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_token_information.rb +208 -0
  46. data/lib/cybersource_rest_client/models/card_processing_config_common_processors.rb +105 -1
  47. data/lib/cybersource_rest_client/models/commerce_solutions_products.rb +15 -5
  48. data/lib/cybersource_rest_client/models/create_credit_request.rb +15 -5
  49. data/lib/cybersource_rest_client/models/get_all_subscriptions_response_order_information_amount_details_surcharge.rb +22 -5
  50. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response.rb +247 -0
  51. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_1.rb +224 -0
  52. data/lib/cybersource_rest_client/models/{pbl_payment_links_post201_response__links.rb → get_subscriptions_payments_response_1__links.rb} +1 -1
  53. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response__links.rb +209 -0
  54. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_cycles_completed_count.rb +191 -0
  55. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_subscription_payment.rb +356 -0
  56. data/lib/cybersource_rest_client/models/inline_response_201_1_tokenized_card.rb +26 -5
  57. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_commerce_solutions.rb +15 -5
  58. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_payments.rb +25 -5
  59. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_risk.rb +15 -5
  60. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_value_added_services.rb +25 -5
  61. data/lib/cybersource_rest_client/models/inline_response_400_10.rb +30 -75
  62. data/lib/cybersource_rest_client/models/{inline_response_400_8_details.rb → inline_response_400_10_details.rb} +1 -1
  63. data/lib/cybersource_rest_client/models/inline_response_400_11.rb +235 -0
  64. data/lib/cybersource_rest_client/models/{inline_response_400_7_details.rb → inline_response_400_11_details.rb} +3 -3
  65. data/lib/cybersource_rest_client/models/inline_response_400_12.rb +281 -0
  66. data/lib/cybersource_rest_client/models/inline_response_400_6.rb +37 -60
  67. data/lib/cybersource_rest_client/models/inline_response_400_7.rb +6 -6
  68. data/lib/cybersource_rest_client/models/inline_response_400_8.rb +58 -36
  69. data/lib/cybersource_rest_client/models/{inline_response_400_6_fields.rb → inline_response_400_8_fields.rb} +1 -1
  70. data/lib/cybersource_rest_client/models/inline_response_400_9.rb +16 -16
  71. data/lib/cybersource_rest_client/models/inline_response_400_9_details.rb +2 -2
  72. data/lib/cybersource_rest_client/models/inline_response_404_3.rb +1 -1
  73. data/lib/cybersource_rest_client/models/inline_response_422_1.rb +1 -1
  74. data/lib/cybersource_rest_client/models/iplv2paymentlinks_order_information_line_items.rb +73 -5
  75. data/lib/cybersource_rest_client/models/mit_reversal_request.rb +11 -1
  76. data/lib/cybersource_rest_client/models/mpp_credentials_request.rb +221 -0
  77. data/lib/cybersource_rest_client/models/mpp_credentials_response200.rb +338 -0
  78. data/lib/cybersource_rest_client/models/patch_customer_payment_instrument_request.rb +1 -1
  79. data/lib/cybersource_rest_client/models/patch_customer_request.rb +1 -1
  80. data/lib/cybersource_rest_client/models/patch_payment_instrument_request.rb +1 -1
  81. data/lib/cybersource_rest_client/models/payment_instrument_list_1__embedded.rb +1 -1
  82. data/lib/cybersource_rest_client/models/payment_instrument_list__embedded.rb +1 -1
  83. data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded__embedded.rb → payment_instrument_list__embedded__embedded.rb} +1 -1
  84. data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded_payment_instruments.rb → payment_instrument_list__embedded_payment_instruments.rb} +2 -2
  85. data/lib/cybersource_rest_client/models/payments_products.rb +25 -5
  86. data/lib/cybersource_rest_client/models/payments_products_currency_conversion_configuration_information_configurations_processors.rb +14 -2
  87. data/lib/cybersource_rest_client/models/payments_products_microform.rb +199 -0
  88. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information.rb +199 -0
  89. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations.rb +189 -0
  90. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features.rb +189 -0
  91. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features_gateway_agnostic.rb +189 -0
  92. data/lib/cybersource_rest_client/models/payments_products_microform_subscription_information.rb +227 -0
  93. data/lib/cybersource_rest_client/models/pbl_payment_links_get200_response.rb +1 -1
  94. data/lib/cybersource_rest_client/models/pbl_payment_links_post201_response.rb +1 -1
  95. data/lib/cybersource_rest_client/models/post_customer_payment_instrument_request.rb +1 -1
  96. data/lib/cybersource_rest_client/models/post_customer_request.rb +1 -1
  97. data/lib/cybersource_rest_client/models/post_payment_instrument_request.rb +1 -1
  98. data/lib/cybersource_rest_client/models/post_tokenized_card_request.rb +15 -5
  99. data/lib/cybersource_rest_client/models/pts_v2_create_billing_agreement_post201_response_agreement_information.rb +80 -1
  100. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +41 -1
  101. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_merchant_information.rb +196 -0
  102. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_account_information.rb +189 -0
  103. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information.rb +15 -5
  104. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information_account_features.rb +196 -0
  105. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_token_information.rb +189 -0
  106. data/lib/cybersource_rest_client/models/pts_v2_modify_billing_agreement_post201_response_agreement_information.rb +35 -1
  107. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_point_of_sale_information.rb +22 -5
  108. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_processor_information.rb +1 -1
  109. data/lib/cybersource_rest_client/models/pts_v2_payments_order_post201_response_order_information_shipping_details.rb +1 -1
  110. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +106 -5
  111. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_strong_authentication.rb +22 -5
  112. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information.rb +15 -5
  113. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_payment_information_tokenized_card.rb → pts_v2_payments_post201_response_payment_account_information_tokenized_card.rb} +1 -1
  114. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
  115. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +18 -1
  116. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +23 -6
  117. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information.rb +15 -5
  118. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information_third_party_token.rb +213 -0
  119. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +1 -1
  120. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_error_information.rb +1 -1
  121. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_order_information_amount_details.rb +18 -1
  122. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +19 -2
  123. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +1 -1
  124. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response_processor_information.rb +7 -1
  125. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information.rb +45 -5
  126. data/lib/cybersource_rest_client/models/{pull_funds201_response_processor_information_avs.rb → pts_v2_payouts_post201_response_processor_information_avs.rb} +1 -1
  127. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_customer.rb +196 -0
  128. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_electronic_verification_results.rb +281 -0
  129. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_buyer_information.rb +196 -0
  130. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_order_information_amount_details.rb +1 -1
  131. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_processing_information.rb +18 -5
  132. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +19 -6
  133. data/lib/cybersource_rest_client/models/ptsv2billingagreements_agreement_information.rb +84 -5
  134. data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information.rb +12 -2
  135. data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information_amount_details.rb +230 -0
  136. data/lib/cybersource_rest_client/models/{ptsv2intents_order_information_invoice_details.rb → ptsv2billingagreements_order_information_invoice_details.rb} +1 -1
  137. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank.rb +15 -5
  138. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank_account_alias.rb +207 -0
  139. data/lib/cybersource_rest_client/models/ptsv2billingagreements_processing_information.rb +18 -1
  140. data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_agreement_information.rb +56 -5
  141. data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_processing_information.rb +18 -1
  142. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +35 -5
  143. data/lib/cybersource_rest_client/models/ptsv2credits_token_information.rb +228 -0
  144. data/lib/cybersource_rest_client/models/ptsv2intents_order_information.rb +1 -1
  145. data/lib/cybersource_rest_client/models/ptsv2intentsid_order_information.rb +1 -1
  146. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +15 -5
  147. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +16 -5
  148. data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +28 -1
  149. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_digital_currency.rb +231 -0
  150. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_shipping_details.rb +23 -6
  151. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +32 -5
  152. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +15 -5
  153. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank_account_alias.rb +207 -0
  154. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_third_party_token.rb +196 -0
  155. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +18 -1
  156. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +72 -6
  157. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_program_indicators.rb +202 -0
  158. data/lib/cybersource_rest_client/models/ptsv2payments_processor_information.rb +56 -5
  159. data/lib/cybersource_rest_client/models/ptsv2payments_recipient_information.rb +16 -5
  160. data/lib/cybersource_rest_client/models/ptsv2payments_sender_information.rb +16 -5
  161. data/lib/cybersource_rest_client/models/ptsv2payments_token_information.rb +32 -5
  162. data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information.rb +193 -0
  163. data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information_authenticated_identities.rb +252 -0
  164. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +15 -5
  165. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_shipping_details.rb +100 -5
  166. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information.rb +22 -5
  167. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +18 -1
  168. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processor_information.rb +39 -5
  169. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information.rb +15 -5
  170. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_shipping_details.rb +196 -0
  171. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +32 -5
  172. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_device_information.rb +196 -0
  173. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_payment_information.rb +22 -5
  174. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +18 -5
  175. data/lib/cybersource_rest_client/models/pull_funds201_response_processor_information.rb +36 -6
  176. data/lib/cybersource_rest_client/models/pull_funds_request.rb +11 -1
  177. data/lib/cybersource_rest_client/models/push_funds201_response_processor_information.rb +45 -5
  178. data/lib/cybersource_rest_client/models/risk_products.rb +15 -5
  179. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_ship_to.rb +39 -5
  180. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_shipping_details.rb +1 -1
  181. data/lib/cybersource_rest_client/models/tms_card_art.rb +23 -1
  182. data/lib/cybersource_rest_client/models/tms_embedded_instrument_identifier_bill_to.rb +22 -5
  183. data/lib/cybersource_rest_client/models/tms_tokenized_card_delete_request.rb +189 -0
  184. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments__embedded.rb +190 -0
  185. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card.rb +22 -1
  186. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_card.rb +1 -1
  187. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata.rb +16 -5
  188. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer.rb +41 -8
  189. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_bank_applications.rb +201 -0
  190. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_capabilities.rb +257 -0
  191. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_verification_results.rb +202 -0
  192. data/lib/cybersource_rest_client/models/tmsv2customers__embedded.rb +200 -0
  193. data/lib/cybersource_rest_client/models/{tmsv3tokenstoken_idpaymentcredentials_order_information_bill_to.rb → tmsv2tokenizedcards_bill_to.rb} +1 -1
  194. data/lib/cybersource_rest_client/models/tmsv2tokenizedcardstokenized_card_iddelete_reason.rb +208 -0
  195. data/lib/cybersource_rest_client/models/tmsv3tokenstoken_idpaymentcredentials_order_information.rb +1 -1
  196. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_shipping_details.rb +1 -1
  197. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_sender_information.rb +1 -1
  198. data/lib/cybersource_rest_client/models/ucv1sessions_data.rb +44 -14
  199. data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information.rb +325 -0
  200. data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information_sub_merchant.rb +366 -0
  201. data/lib/cybersource_rest_client/models/ucv1sessions_data_consumer_authentication_information.rb +22 -5
  202. data/lib/cybersource_rest_client/models/ucv1sessions_data_installment_information.rb +196 -0
  203. data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information.rb +22 -5
  204. data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information_merchant_descriptor.rb +18 -1
  205. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information.rb +16 -6
  206. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_amount_details.rb +86 -12
  207. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details.rb +242 -0
  208. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details_transaction_advice_addendum.rb +196 -0
  209. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_line_items.rb +702 -0
  210. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_shipping_details.rb +213 -0
  211. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information.rb +38 -1
  212. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_bank_transfer_options.rb +196 -0
  213. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_recurring_options.rb +192 -0
  214. data/lib/cybersource_rest_client/models/ucv1sessions_data_recipient_information.rb +107 -53
  215. data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information.rb +376 -0
  216. data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information_account.rb +213 -0
  217. data/lib/cybersource_rest_client/models/update_payments.rb +192 -0
  218. data/lib/cybersource_rest_client/models/value_added_services_products.rb +25 -5
  219. data/lib/cybersource_rest_client.rb +71 -12
  220. metadata +78 -19
  221. data/lib/cybersource_rest_client/api/token_api.rb +0 -306
  222. data/lib/cybersource_rest_client/api/tokenized_card_api.rb +0 -371
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7b2145187caddc5e65d832429b125682e89bd7cb5524cce56ac174480dd8fb8
4
- data.tar.gz: '05439a8ea021577faf619bc4ceff17236524baf1cfaa3738f8712ae278c1f671'
3
+ metadata.gz: bb5d050b359e9fefb56a6f04e11510cc45f1c1b6f033a621495b4f82ff2d8a64
4
+ data.tar.gz: b8e37d57a3d3ec9a63ce79cb5115df8c41bedaeef333d774673f4ae07aafecc4
5
5
  SHA512:
6
- metadata.gz: 82bf63f6b1166f9822849d41bbad0999a78318d158bd891af281e7cee28b6f421b45cc56c6bb309feaf660ecdd1551801976f5091f7bc5419c82f7fdd8e70e27
7
- data.tar.gz: a2b31e89fea58024cf133481dc8ee379a7ab7f94d810150b77738456f62763125da4a0d0c7342cb7adc4cb05aa365c39ff8afe254ba65e089c7ce6f7146a96ad
6
+ metadata.gz: f712d7cca99ab978f9115b6dea2849c27c65ed3d899d5614d5687426f8d6b90d5b123f12647e7e3356f09028264f6a2a25f5a0dbeb3992af776533448f754836
7
+ data.tar.gz: bf26f45d42ad16decfe75998c29b338e0a111d36290064a2ac625f14627c47927e8828ca32e991bd067b07fdf5f21740f03278948f202f5192a569068321ea4e
@@ -22,19 +22,41 @@ public
22
22
  @log_obj = Log.new merchantconfig_obj.log_config, "JwtToken"
23
23
 
24
24
  begin
25
- # Get payload claim set for JWTv2
25
+ # Get payload claim set for JWTv2 (identical for both key types)
26
26
  payload_claim_set = getPayloadClaimSet(merchantconfig_obj, isResponseMLEForApi)
27
-
28
- # Get cached certificate and private key
29
- cache_value = Cache.new.fetchCachedP12Certificate(merchantconfig_obj)
30
- private_key = cache_value.private_key
31
- jwt_cert_obj = cache_value.cert
32
-
33
- # Get header claim set for JWTv2
34
- header_claim_set = getHeaderClaimSet(jwt_cert_obj)
35
-
36
- # Generate JWT token using RS256 algorithm
37
- token = JWT.encode(payload_claim_set, private_key, 'RS256', header_claim_set)
27
+ token = ''
28
+ if merchantconfig_obj.is_shared_secret_key_type?
29
+ # Shared Secret (HMAC-SHA256) signing
30
+ @log_obj.logger.debug('Generating JWT token using shared secret (HS256)')
31
+
32
+ secret_key = merchantconfig_obj.merchantSecretKey
33
+ begin
34
+ secret_key_decoded = Base64.strict_decode64(secret_key)
35
+ rescue ArgumentError => e
36
+ raise StandardError.new("Invalid base64-encoded secret key: #{e.message}")
37
+ end
38
+
39
+ # Get header claim set with merchantKeyId as kid
40
+ header_claim_set = getHeaderClaimSet(merchant_key_id: merchantconfig_obj.merchantKeyId)
41
+
42
+ # Generate JWT token using HS256 algorithm
43
+ token = JWT.encode(payload_claim_set, secret_key_decoded, 'HS256', header_claim_set)
44
+ else
45
+ # P12 Certificate (RSA-SHA256) signing — existing behavior
46
+ @log_obj.logger.debug('Generating JWT token using P12 certificate (RS256)')
47
+
48
+ # Get cached certificate and private key
49
+ cache_value = Cache.new.fetchCachedP12Certificate(merchantconfig_obj)
50
+ private_key = cache_value.private_key
51
+ jwt_cert_obj = cache_value.cert
52
+
53
+ # Get header claim set with certificate serial number as kid
54
+ header_claim_set = getHeaderClaimSet(certificate: jwt_cert_obj)
55
+
56
+ # Generate JWT token using RS256 algorithm
57
+ token = JWT.encode(payload_claim_set, private_key, 'RS256', header_claim_set)
58
+ end
59
+
38
60
  return token
39
61
  rescue StandardError => err
40
62
  if err.message.include? 'PKCS12_parse: mac verify failure'
@@ -68,7 +90,7 @@ public
68
90
  # Set the request method, host and resource path in the JWT body as per the specification for all request types
69
91
  jwt_payload['request-method'] = request_type
70
92
  jwt_payload['request-host'] = merchantconfig_obj.requestHost
71
- jwt_payload['request-resource-path'] = extractResourcePath(merchantconfig_obj.requestTarget)
93
+ jwt_payload['request-resource-path'] = merchantconfig_obj.requestTarget
72
94
 
73
95
  # Choose issuer claim in the JWT body as per the use_metakey flag in the config file
74
96
  if merchantconfig_obj.useMetaKey
@@ -90,26 +112,23 @@ public
90
112
  return jwt_payload
91
113
  end
92
114
 
93
- def getHeaderClaimSet(jwt_cert_obj)
94
- # Extract serial number from certificate for kid header
95
- serial_number = MLEUtility.extract_serial_number_from_certificate(jwt_cert_obj)
96
-
115
+ def getHeaderClaimSet(merchant_key_id: nil, certificate: nil)
116
+ kid_value = ''
117
+ if !certificate.nil?
118
+ kid_value = MLEUtility.extract_serial_number_from_certificate(certificate)
119
+ elsif !merchant_key_id.nil? && !merchant_key_id.to_s.empty?
120
+ kid_value = merchant_key_id
121
+ else
122
+ raise StandardError.new("Either certificate or merchant_key_id must be provided for JWT header")
123
+ end
124
+
97
125
  jwt_headers = {
98
- 'kid' => serial_number,
126
+ 'kid' => kid_value,
99
127
  'typ' => 'JWT'
100
128
  }
101
129
 
102
- # Add any other future parameters to the header claim set here
103
130
  return jwt_headers
104
131
  end
105
132
 
106
- def extractResourcePath(request_target)
107
- return '' if request_target.nil? || request_target.empty?
108
-
109
- # Split the string to remove the query params
110
- parts = request_target.split('?', 2)
111
- return parts[0]
112
- end
113
-
114
133
  implements TokenInterface
115
134
  end
@@ -28,9 +28,11 @@ public
28
28
  @keyAlias = cybsPropertyObj['keyAlias']
29
29
  @keyPass = cybsPropertyObj['keyPass']
30
30
  @keyFilename = cybsPropertyObj['keyFilename']
31
+ @jwtKeyType = cybsPropertyObj['jwtKeyType'] ? cybsPropertyObj['jwtKeyType'].to_s.upcase : Constants::JWT_KEY_TYPE_P12
31
32
  @useMetaKey = cybsPropertyObj['useMetaKey']
32
33
  @portfolioID = cybsPropertyObj['portfolioID']
33
34
  @solutionId = cybsPropertyObj['solutionId']
35
+ @isSDK = cybsPropertyObj['isSDK'] == true || cybsPropertyObj['isSDK'].to_s.strip.casecmp?('true')
34
36
  @p12KeyFilePath = nil
35
37
  # MutualAuth & OAuth Parameters
36
38
  @enableClientCert = cybsPropertyObj['enableClientCert']
@@ -229,40 +231,52 @@ public
229
231
  elsif !@merchantId.instance_of? String
230
232
  @merchantId=@merchantId.to_s
231
233
  end
232
- if @keyAlias.to_s.empty?
233
- @keyAlias = @merchantId
234
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_ALIAS_NULL_EMPTY)
235
- elsif !@keyAlias.instance_of? String
236
- @keyAlias=@keyAlias.to_s
237
- end
238
- if !@useMetaKey && @keyAlias != @merchantId
239
- @keyAlias = @merchantId
240
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS)
241
- end
242
- if @useMetaKey && @keyAlias != @portfolioID
243
- @keyAlias = @portfolioID
244
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS_USE_METAKEY)
245
- end
246
- if @keyPass.to_s.empty?
247
- @keyPass = @merchantId
248
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_PASS_NULL)
249
- elsif !@keyPass.instance_of? String
250
- @keyPass=@keyPass.to_s
251
- end
252
- if @keysDirectory.to_s.empty?
253
- @keysDirectory = Constants::DEFAULT_KEY_DIRECTORY
254
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_DIRECTORY_EMPTY + @keysDirectory)
255
- elsif !@keysDirectory.instance_of? String
256
- @keysDirectory=@keysDirectory.to_s
257
- end
258
- if @keyFilename.to_s.empty?
259
- @keyFilename = @merchantId
260
- @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_FILE_NAME_NULL_EMPTY)
261
- elsif !@keyFilename.instance_of? String
262
- @keyFilename=@keyFilename.to_s
263
- end
264
- if !check_key_file
265
- @log_obj.logger.error(ExceptionHandler.new.new_custom_error "Error finding or accessing the Key Directory or Key File. Please review the values in the merchant configuration.")
234
+
235
+ # Validate jwtKeyType
236
+ check_jwt_key_type
237
+
238
+ if is_shared_secret_key_type?
239
+ # Shared Secret validation — same credentials as HTTP_SIGNATURE
240
+ validateSharedSecretKeyCredentials()
241
+ else
242
+ # P12 validation (existing behavior)
243
+ if @keyAlias.to_s.empty?
244
+ @keyAlias = @merchantId
245
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_ALIAS_NULL_EMPTY)
246
+ elsif !@keyAlias.instance_of? String
247
+ @keyAlias=@keyAlias.to_s
248
+ end
249
+ if !@useMetaKey && @keyAlias != @merchantId
250
+ @keyAlias = @merchantId
251
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS)
252
+ end
253
+ if @useMetaKey && @keyAlias != @portfolioID
254
+ @keyAlias = @portfolioID
255
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS_USE_METAKEY)
256
+ end
257
+ if @keyPass.to_s.empty?
258
+ @keyPass = @merchantId
259
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_PASS_NULL)
260
+ elsif !@keyPass.instance_of? String
261
+ @keyPass=@keyPass.to_s
262
+ end
263
+ if @keysDirectory.to_s.empty?
264
+ @keysDirectory = Constants::DEFAULT_KEY_DIRECTORY
265
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_DIRECTORY_EMPTY + @keysDirectory)
266
+ elsif !@keysDirectory.instance_of? String
267
+ @keysDirectory=@keysDirectory.to_s
268
+ end
269
+ if @keyFilename.to_s.empty?
270
+ @keyFilename = @merchantId
271
+ @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_FILE_NAME_NULL_EMPTY)
272
+ elsif !@keyFilename.instance_of? String
273
+ @keyFilename=@keyFilename.to_s
274
+ end
275
+ if !check_key_file
276
+ err = StandardError.new(Constants::ERROR_PREFIX + "Cannot find or access the Key Directory or Key File. Please review the values in the merchant configuration.")
277
+ @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
278
+ raise err
279
+ end
266
280
  end
267
281
  end
268
282
  if @authenticationType.upcase == Constants::AUTH_TYPE_MUTUAL_AUTH
@@ -305,20 +319,7 @@ public
305
319
  elsif !@merchantId.instance_of? String
306
320
  @merchantId=@merchantId.to_s
307
321
  end
308
- if @merchantKeyId.to_s.empty?
309
- err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_KEY_ID_MANDATORY)
310
- @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
311
- raise err
312
- elsif !@merchantKeyId.instance_of? String
313
- @merchantKeyId=@merchantKeyId.to_s
314
- end
315
- if @merchantSecretKey.to_s.empty?
316
- err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_SECRET_KEY_MANDATORY)
317
- @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
318
- raise err
319
- elsif !@merchantSecretKey.instance_of? String
320
- @merchantSecretKey=@merchantSecretKey.to_s
321
- end
322
+ validateSharedSecretKeyCredentials()
322
323
  end
323
324
  if @useMetaKey && @portfolioID.to_s.empty?
324
325
  err = StandardError.new(Constants::ERROR_PREFIX+ Constants::PORTFOLIO_ID_MANDATORY)
@@ -337,6 +338,23 @@ public
337
338
  end
338
339
  end
339
340
 
341
+ def validateSharedSecretKeyCredentials()
342
+ if @merchantKeyId.to_s.empty?
343
+ err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_KEY_ID_MANDATORY)
344
+ @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
345
+ raise err
346
+ elsif !@merchantKeyId.instance_of? String
347
+ @merchantKeyId=@merchantKeyId.to_s
348
+ end
349
+ if @merchantSecretKey.to_s.empty?
350
+ err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_SECRET_KEY_MANDATORY)
351
+ @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
352
+ raise err
353
+ elsif !@merchantSecretKey.instance_of? String
354
+ @merchantSecretKey=@merchantSecretKey.to_s
355
+ end
356
+ end
357
+
340
358
  def validateMLEConfiguration(cybsPropertyObj)
341
359
  if !@useMLEGlobally.nil? && !cybsPropertyObj['enableRequestMLEForOptionalApisGlobally'].nil?
342
360
  if @useMLEGlobally != cybsPropertyObj['enableRequestMLEForOptionalApisGlobally']
@@ -588,6 +606,20 @@ public
588
606
  @log_obj.logger.info('Merchant Configuration :\n' + propertyObj.to_s)
589
607
  end
590
608
 
609
+ # Returns true when jwtKeyType is SHARED_SECRET
610
+ def is_shared_secret_key_type?
611
+ !@jwtKeyType.nil? && @jwtKeyType.upcase == Constants::JWT_KEY_TYPE_SHARED_SECRET
612
+ end
613
+
614
+ # Validates that jwtKeyType is either P12 or SHARED_SECRET
615
+ def check_jwt_key_type
616
+ unless @jwtKeyType.upcase == Constants::JWT_KEY_TYPE_P12 || @jwtKeyType.upcase == Constants::JWT_KEY_TYPE_SHARED_SECRET
617
+ err = StandardError.new(Constants::ERROR_PREFIX + Constants::INVALID_JWT_KEY_TYPE)
618
+ @log_obj.logger.error(ExceptionHandler.new.new_api_exception err)
619
+ raise err
620
+ end
621
+ end
622
+
591
623
  def check_key_file
592
624
  # Directory exists?
593
625
  unless Dir.exist?(@keysDirectory)
@@ -629,6 +661,7 @@ public
629
661
  attr_accessor :keyAlias
630
662
  attr_accessor :keyPass
631
663
  attr_accessor :keyFilename
664
+ attr_accessor :jwtKeyType
632
665
  attr_accessor :useMetaKey
633
666
  attr_accessor :portfolioID
634
667
  attr_accessor :keepAliveTime
@@ -652,6 +685,7 @@ public
652
685
  attr_accessor :requestTarget
653
686
  attr_accessor :log_obj
654
687
  attr_accessor :solutionId
688
+ attr_accessor :isSDK
655
689
  attr_accessor :defaultCustomHeaders
656
690
  attr_accessor :pemFileDirectory
657
691
  attr_accessor :useMLEGlobally
@@ -126,8 +126,8 @@ public
126
126
  if merchantConfig.mleForRequestPublicCertPath && !merchantConfig.mleForRequestPublicCertPath.strip.empty?
127
127
  certificate_identifier = Constants::MLE_CACHE_IDENTIFIER_FOR_CONFIG_CERT
128
128
  certificate_file_path = merchantConfig.mleForRequestPublicCertPath
129
- # Priority #2: If mleForRequestPublicCertPath not provided, get mlecert from p12 if provided and jwt auth type
130
- elsif Constants::AUTH_TYPE_JWT.downcase == merchantConfig.authenticationType.downcase && merchantConfig.p12KeyFilePath
129
+ # Priority #2: If mleForRequestPublicCertPath not provided, get mlecert from p12 if provided and jwt auth type (only for P12 key type, not SHARED_SECRET)
130
+ elsif Constants::AUTH_TYPE_JWT.downcase == merchantConfig.authenticationType.downcase && !merchantConfig.is_shared_secret_key_type? && merchantConfig.p12KeyFilePath
131
131
  certificate_identifier = Constants::MLE_CACHE_IDENTIFIER_FOR_P12_CERT
132
132
  certificate_file_path = merchantConfig.p12KeyFilePath
133
133
  # Priority #3: Get mlecert from default cert in SDK as per CAS or PROD env.
@@ -224,10 +224,13 @@ public
224
224
  merchant_config.responseMlePrivateKeyFilePassword
225
225
  )
226
226
 
227
- merchant_cert = Utility.getCertificateBasedOnKeyAlias(certificate_list, merchant_config.merchantId)
227
+ # Use correct alias for MetaKey mode: portfolioID when useMetaKey is true, merchantId otherwise
228
+ response_mle_key_alias = merchant_config.useMetaKey ? merchant_config.portfolioID : merchant_config.merchantId
229
+
230
+ merchant_cert = Utility.getCertificateBasedOnKeyAlias(certificate_list, response_mle_key_alias)
228
231
 
229
232
  if merchant_cert.nil?
230
- raise StandardError.new("No certificate found for Response MLE Private Key file with merchant ID alias #{merchant_config.merchantId}")
233
+ raise StandardError.new("No certificate found for Response MLE Private Key file with alias '#{response_mle_key_alias}'")
231
234
  end
232
235
 
233
236
  # Check if this is a CyberSource-generated P12 file
@@ -66,6 +66,12 @@
66
66
 
67
67
  AUTH_TYPE_JWT = 'JWT' unless const_defined?(:AUTH_TYPE_JWT)
68
68
 
69
+ JWT_KEY_TYPE_P12 = 'P12' unless const_defined?(:JWT_KEY_TYPE_P12)
70
+
71
+ JWT_KEY_TYPE_SHARED_SECRET = 'SHARED_SECRET' unless const_defined?(:JWT_KEY_TYPE_SHARED_SECRET)
72
+
73
+ INVALID_JWT_KEY_TYPE = "Invalid jwtKeyType. Must be 'P12' or 'SHARED_SECRET'." unless const_defined?(:INVALID_JWT_KEY_TYPE)
74
+
69
75
  OLD_RUN_ENVIRONMENT_CONSTANTS = ['CYBERSOURCE.ENVIRONMENT.SANDBOX', 'CYBERSOURCE.ENVIRONMENT.PRODUCTION', 'CYBERSOURCE.IN.ENVIRONMENT.SANDBOX', 'CYBERSOURCE.IN.ENVIRONMENT.PRODUCTION', 'BANKOFAMERICA.ENVIRONMENT.SANDBOX', 'BANKOFAMERICA.ENVIRONMENT.PRODUCTION']
70
76
 
71
77
  # constants for fall back logic
@@ -48,6 +48,15 @@ public
48
48
  return requestBody
49
49
  end
50
50
 
51
+ # Check if using shared secret JWT without explicit MLE certificate path
52
+ if mleCertificate.nil? &&
53
+ Constants::AUTH_TYPE_JWT.downcase == merchantConfig.authenticationType.downcase &&
54
+ merchantConfig.is_shared_secret_key_type?
55
+ @log_obj.logger.debug("MLE for requests with JWT shared secret authentication requires mleForRequestPublicCertPath to be explicitly provided in merchant configuration.")
56
+ @log_obj.logger.debug("Please set mleForRequestPublicCertPath to the path of your MLE public certificate file.")
57
+ raise StandardError.new(Constants::ERROR_PREFIX + "Missing MLE certificate for JWT shared secret authentication. Please provide the MLE public certificate path in the configuration.")
58
+ end
59
+
51
60
  begin
52
61
  serial_number = self.extract_serial_number_from_certificate(mleCertificate)
53
62
 
@@ -239,7 +239,7 @@ module CyberSource
239
239
  # header parameters
240
240
  header_params = {}
241
241
  # HTTP header 'Accept' (if needed)
242
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/json;charset=utf-8'])
243
243
  # HTTP header 'Content-Type'
244
244
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
245
245
 
@@ -138,7 +138,7 @@ module CyberSource
138
138
  # header parameters
139
139
  header_params = {}
140
140
  # HTTP header 'Accept' (if needed)
141
- header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
141
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
142
142
  # HTTP header 'Content-Type'
143
143
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
144
144
 
@@ -182,27 +182,27 @@ module CyberSource
182
182
  # Create Webhook Security Keys
183
183
  # Create security keys that CyberSource will use internally to connect to your servers and validate messages using a digital signature. Select the CREATE example for CyberSource to generate the key on our server and maintain it for you as well. Remember to save the key in the API response, so that you can use it to validate messages later.
184
184
  #
185
- # @param v_c_sender_organization_id Sender organization id
186
- # @param v_c_permissions Encoded user permissions returned by the CGK, for the entity user who initiated the boarding
187
185
  # @param [Hash] opts the optional parameters
188
186
  # @option opts [String] :v_c_correlation_id A globally unique id associated with your request
187
+ # @option opts [String] :v_c_sender_organization_id Sender organization id
188
+ # @option opts [String] :v_c_permissions Encoded user permissions returned by the CGK, for the entity user who initiated the boarding
189
189
  # @option opts [SaveSymEgressKey] :save_sym_egress_key Provide egress Symmetric key information to save (create or store or refresh)
190
190
  # @return [InlineResponse2015]
191
191
  #
192
- def save_sym_egress_key(v_c_sender_organization_id, v_c_permissions, opts = {})
193
- data, status_code, headers = save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissions, opts)
192
+ def save_sym_egress_key(opts = {})
193
+ data, status_code, headers = save_sym_egress_key_with_http_info(opts)
194
194
  return data, status_code, headers
195
195
  end
196
196
 
197
197
  # Create Webhook Security Keys
198
198
  # Create security keys that CyberSource will use internally to connect to your servers and validate messages using a digital signature. Select the CREATE example for CyberSource to generate the key on our server and maintain it for you as well. Remember to save the key in the API response, so that you can use it to validate messages later.
199
- # @param v_c_sender_organization_id Sender organization id
200
- # @param v_c_permissions Encoded user permissions returned by the CGK, for the entity user who initiated the boarding
201
199
  # @param [Hash] opts the optional parameters
202
200
  # @option opts [String] :v_c_correlation_id A globally unique id associated with your request
201
+ # @option opts [String] :v_c_sender_organization_id Sender organization id
202
+ # @option opts [String] :v_c_permissions Encoded user permissions returned by the CGK, for the entity user who initiated the boarding
203
203
  # @option opts [SaveSymEgressKey] :save_sym_egress_key Provide egress Symmetric key information to save (create or store or refresh)
204
204
  # @return [Array<(InlineResponse2015, Fixnum, Hash)>] InlineResponse2015 data, response status code and response headers
205
- def save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissions, opts = {})
205
+ def save_sym_egress_key_with_http_info(opts = {})
206
206
 
207
207
  if @api_client.config.debugging
208
208
  begin
@@ -212,22 +212,14 @@ module CyberSource
212
212
  puts 'Cannot write to log'
213
213
  end
214
214
  end
215
- # verify the required parameter 'v_c_sender_organization_id' is set
216
- if @api_client.config.client_side_validation && v_c_sender_organization_id.nil?
217
- fail ArgumentError, "Missing the required parameter 'v_c_sender_organization_id' when calling CreateNewWebhooksApi.save_sym_egress_key"
218
- end
219
- #if @api_client.config.client_side_validation && v_c_sender_organization_id !~ Regexp.new(/^[A-Za-z0-9\\-_]+$/)
220
- #fail ArgumentError, "invalid value for 'v_c_sender_organization_id' when calling CreateNewWebhooksApi.save_sym_egress_key, must conform to the pattern /^[A-Za-z0-9\\-_]+$/."
221
- #end
222
-
223
- # verify the required parameter 'v_c_permissions' is set
224
- if @api_client.config.client_side_validation && v_c_permissions.nil?
225
- fail ArgumentError, "Missing the required parameter 'v_c_permissions' when calling CreateNewWebhooksApi.save_sym_egress_key"
226
- end
227
215
  #if @api_client.config.client_side_validation && !opts[:'v_c_correlation_id'].nil? && opts[:'v_c_correlation_id'] !~ Regexp.new(/^[A-Za-z0-9\\.\\-_:]+$/)
228
216
  #fail ArgumentError, "invalid value for 'opts[:\"v_c_correlation_id\"]' when calling CreateNewWebhooksApi.save_sym_egress_key, must conform to the pattern /^[A-Za-z0-9\\.\\-_:]+$/."
229
217
  #end
230
218
 
219
+ #if @api_client.config.client_side_validation && !opts[:'v_c_sender_organization_id'].nil? && opts[:'v_c_sender_organization_id'] !~ Regexp.new(/^[A-Za-z0-9\\-_]+$/)
220
+ #fail ArgumentError, "invalid value for 'opts[:\"v_c_sender_organization_id\"]' when calling CreateNewWebhooksApi.save_sym_egress_key, must conform to the pattern /^[A-Za-z0-9\\-_]+$/."
221
+ #end
222
+
231
223
  # resource path
232
224
  local_var_path = 'kms/egress/v2/keys-sym'
233
225
 
@@ -240,9 +232,9 @@ module CyberSource
240
232
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
241
233
  # HTTP header 'Content-Type'
242
234
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
243
- header_params[:'v-c-sender-organization-id'] = v_c_sender_organization_id
244
- header_params[:'v-c-permissions'] = v_c_permissions
245
235
  header_params[:'v-c-correlation-id'] = opts[:'v_c_correlation_id'] if !opts[:'v_c_correlation_id'].nil?
236
+ header_params[:'v-c-sender-organization-id'] = opts[:'v_c_sender_organization_id'] if !opts[:'v_c_sender_organization_id'].nil?
237
+ header_params[:'v-c-permissions'] = opts[:'v_c_permissions'] if !opts[:'v_c_permissions'].nil?
246
238
 
247
239
  # form parameters
248
240
  form_params = {}
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.38
10
+ =end
11
+
12
+ require 'uri'
13
+ require 'AuthenticationSDK/util/MLEUtility'
14
+ module CyberSource
15
+ class CredentialsApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default, config)
19
+ @api_client = api_client
20
+ @api_client.set_configuration(config)
21
+ end
22
+ # Provision MPP credentials
23
+ # Provisions an encrypted MPP credential for use as the credential payload in an Authorization: Payment header (MPP spec Section 8.2). The caller provides an instrument identifier (referencing a stored card in TMS) and the challenge context from the merchant's 402 response, including the merchant's RSA public encryption key. This service: 1. Calls TMS to retrieve the network token and cryptogram for the instrument. 2. Builds the token plaintext (MPP spec Section 8.3, type: network_token). 3. Encrypts the plaintext using RSA-OAEP with SHA-256 and the merchant's public key. 4. Returns the MPP credential payload fields (MPP spec Section 8.2, Table 4).
24
+ #
25
+ # @param mpp_credentials_request
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [MppCredentialsResponse200]
28
+ #
29
+ def provision_mpp_credentials(mpp_credentials_request, opts = {})
30
+ data, status_code, headers = provision_mpp_credentials_with_http_info(mpp_credentials_request, opts)
31
+ return data, status_code, headers
32
+ end
33
+
34
+ # Provision MPP credentials
35
+ # Provisions an encrypted MPP credential for use as the credential payload in an Authorization: Payment header (MPP spec Section 8.2). The caller provides an instrument identifier (referencing a stored card in TMS) and the challenge context from the merchant&#39;s 402 response, including the merchant&#39;s RSA public encryption key. This service: 1. Calls TMS to retrieve the network token and cryptogram for the instrument. 2. Builds the token plaintext (MPP spec Section 8.3, type: network_token). 3. Encrypts the plaintext using RSA-OAEP with SHA-256 and the merchant&#39;s public key. 4. Returns the MPP credential payload fields (MPP spec Section 8.2, Table 4).
36
+ # @param mpp_credentials_request
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(MppCredentialsResponse200, Fixnum, Hash)>] MppCredentialsResponse200 data, response status code and response headers
39
+ def provision_mpp_credentials_with_http_info(mpp_credentials_request, opts = {})
40
+
41
+ if @api_client.config.debugging
42
+ begin
43
+ raise
44
+ @api_client.config.logger.debug 'Calling API: CredentialsApi.provision_mpp_credentials ...'
45
+ rescue
46
+ puts 'Cannot write to log'
47
+ end
48
+ end
49
+ # verify the required parameter 'mpp_credentials_request' is set
50
+ if @api_client.config.client_side_validation && mpp_credentials_request.nil?
51
+ fail ArgumentError, "Missing the required parameter 'mpp_credentials_request' when calling CredentialsApi.provision_mpp_credentials"
52
+ end
53
+ # resource path
54
+ local_var_path = 'acp/v1/mpp/credentials'
55
+
56
+ # query parameters
57
+ query_params = {}
58
+
59
+ # header parameters
60
+ header_params = {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
63
+ # HTTP header 'Content-Type'
64
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
65
+
66
+ # form parameters
67
+ form_params = {}
68
+
69
+ # http body (model)
70
+ post_body = @api_client.object_to_http_body(mpp_credentials_request)
71
+ sdk_tracker = SdkTracker.new
72
+ post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MppCredentialsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
73
+ inbound_mle_status = "mandatory"
74
+ if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["provision_mpp_credentials","provision_mpp_credentials_with_http_info"])
75
+ begin
76
+ post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
77
+ rescue
78
+ raise
79
+ end
80
+ end
81
+
82
+ is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["provision_mpp_credentials","provision_mpp_credentials_with_http_info"])
83
+
84
+ auth_names = []
85
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
86
+ :header_params => header_params,
87
+ :query_params => query_params,
88
+ :form_params => form_params,
89
+ :body => post_body,
90
+ :auth_names => auth_names,
91
+ :return_type => 'MppCredentialsResponse200',
92
+ :isResponseMLEForApi => is_response_mle_for_api)
93
+ if @api_client.config.debugging
94
+ begin
95
+ raise
96
+ @api_client.config.logger.debug "API called: CredentialsApi#provision_mpp_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97
+ rescue
98
+ puts 'Cannot write to log'
99
+ end
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+ end
104
+ end
@@ -210,7 +210,7 @@ module CyberSource
210
210
  # @option opts [String] :profile_id The Id of a profile containing user specific TMS configuration.
211
211
  # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. (default to 0)
212
212
  # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (default to 20)
213
- # @return [PaymentInstrumentList]
213
+ # @return [PaymentInstrumentList1]
214
214
  #
215
215
  def get_customer_payment_instruments_list(customer_id, opts = {})
216
216
  data, status_code, headers = get_customer_payment_instruments_list_with_http_info(customer_id, opts)
@@ -224,7 +224,7 @@ module CyberSource
224
224
  # @option opts [String] :profile_id The Id of a profile containing user specific TMS configuration.
225
225
  # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
226
226
  # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
227
- # @return [Array<(PaymentInstrumentList, Fixnum, Hash)>] PaymentInstrumentList data, response status code and response headers
227
+ # @return [Array<(PaymentInstrumentList1, Fixnum, Hash)>] PaymentInstrumentList1 data, response status code and response headers
228
228
  def get_customer_payment_instruments_list_with_http_info(customer_id, opts = {})
229
229
 
230
230
  if @api_client.config.debugging
@@ -282,7 +282,7 @@ module CyberSource
282
282
  :form_params => form_params,
283
283
  :body => post_body,
284
284
  :auth_names => auth_names,
285
- :return_type => 'PaymentInstrumentList',
285
+ :return_type => 'PaymentInstrumentList1',
286
286
  :isResponseMLEForApi => is_response_mle_for_api)
287
287
  if @api_client.config.debugging
288
288
  begin
@@ -20,7 +20,7 @@ module CyberSource
20
20
  @api_client.set_configuration(config)
21
21
  end
22
22
  # Enroll a card
23
- # Enroll a card for tokenization during the customer's account registration or when the customer starts a new purchase intent.
23
+ # Enroll a payment card for agentic or e-commerce transactions. This is typically the first step in the Intelligent Commerce payment lifecycle — the agent calls this endpoint to register a consumer's card, creating a tokenized reference that can be used in subsequent purchase instructions and payment credential retrieval. Requires device information, consumer identity, billing details, and payment instrument references. Returns a status of ACTIVE (HTTP 200) if enrollment completes immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. Call this endpoint when a consumer wants to add a new payment card or when setting up a card for agentic payment flows.
24
24
  #
25
25
  # @param agentic_card_enrollment_request
26
26
  # @param [Hash] opts the optional parameters
@@ -32,7 +32,7 @@ module CyberSource
32
32
  end
33
33
 
34
34
  # Enroll a card
35
- # Enroll a card for tokenization during the customer&#39;s account registration or when the customer starts a new purchase intent.
35
+ # Enroll a payment card for agentic or e-commerce transactions. This is typically the first step in the Intelligent Commerce payment lifecycle — the agent calls this endpoint to register a consumer&#39;s card, creating a tokenized reference that can be used in subsequent purchase instructions and payment credential retrieval. Requires device information, consumer identity, billing details, and payment instrument references. Returns a status of ACTIVE (HTTP 200) if enrollment completes immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. Call this endpoint when a consumer wants to add a new payment card or when setting up a card for agentic payment flows.
36
36
  # @param agentic_card_enrollment_request
37
37
  # @param [Hash] opts the optional parameters
38
38
  # @return [Array<(AgenticCardEnrollmentResponse200, Fixnum, Hash)>] AgenticCardEnrollmentResponse200 data, response status code and response headers