HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Configure Payment Service

Describes the Payment Service installation process for Optimizely Commerce Connect

With Optimizely Commerce's Payment Service, you can add payment gateway providers to your ecommerce. Payment Service uses Spreedly's iFrame to offer more flexibility and stability.

  • Use a payment platform without implementing new code.
  • Access more payment gateway options.
  • Implement multiple payment services on a single website.

See Spreedly's documentation for information on the following:

Payment Service options

NameData typeDescriptionRequired
PaymentServiceIsEnabledBooleanIndicates whether PaymentService is enabledNo
EnvironmentNameStringEnvironment nameNo
EnvironmentKeyStringEnvironment keyYes
GatewayTokenStringGateway tokenYes
ScaProviderKeyStringSca provider key when using 3DSYes, if 3DS is enabled
ThreeDsIsEnabledBooleanIndicates whether 3DS is enabledNo
ThreeDsTestModeBooleanIndicates whether 3DS is in test modeNo
ThreeDsTestCallbackUrlString3DS call back URL testing – The URL is accessible from the internet. Optimizely can use webhook.site to expose localhost to the internet.No
PaymentServiceUrlStringPayment Service URLYes
AuthenticationTypeStringHMAC or OBOYes
AppKeyStringApp keyYes
SecretKeyStringSecret keyYes
SigningSecretStringSigning secret when using 3DS modeYes, if 3DS is enabled
InstanceIdentifierStringInstance Identifier when AuthenticationType is OBOYes, if AuthenticationType is OBO

Integration guide with example

See Configure Payment Service for the steps to integrate Payment Service with Commerce Connect.

Click to download the changed files.

List of files modified

FileModificationDescription
wwwroot/js/paymentservice.jsAddedJavaScript file that handles all Checkout form events with or without 3DS mode and based on Spreedly Iframe link.
wwwroot/js/js/Checkout.jsChangedImproved handling for multiple payments for Checkout page.
Views/Shared/Payment/\_PaymentService.cshtmlAddedRender payment form for end-user. This view uses PaymentService.js to handle all events for Checkout form. The Spreedly JavaScript API tokenizes CC/CVVs. There are some hidden elements for handling 3DS mode.
Views/Shared/PaymentServiceConfirmation.cshtmlAddedRender confirmation after user successfully places order.
Features/Checkout/Controllers/CheckoutController.csChangedLogic handling for Payment Service.
Features/Checkout/Services/CheckoutService.csChangedLogic handling for Payment Service.
Features/Checkout/ViewModels/PaymentServicePaymentViewModel.csAddedModel map Payment Service payment for better handling at client side.
Infrastructure/SiteImport/ImportSiteContentStep.csChangedStep to import Payment Service automatically besides adding Payment Service manually in Administration
lang/Quicksilver_EN.xmlChangedLanguage keys for Payment Service checkout form.
List of modified files

Details about the described changes

  • lang/Quicksilver_EN.xml

  • Features/Checkout/Controllers/CheckoutController.cs

  • Features/Checkout/Services/CheckoutService.cs

  • Infrastructure/SiteImport/ImportSiteContentStep.cs