Configure Payment Service

  • Updated

You must log in with Opti ID to use this feature. Email Optimizely Support to have your commerce instance added to Opti ID.

For Configured Commerce, you must also have version 5.2.2406 or newer. This feature is not available for the Configured Commerce SDK.

With Optimizely Commerce's Payment Service, you can add payment gateway providers for your ecommerce. This 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.

Although Payment Service supports multiple gateways for a single site, there is currently a limit of one gateway per site in Optimizely Configured Commerce. Work with your partner if you want to customize this.

Prerequisites

Before you enable Payment Service for Optimizely Configured Commerce or Optimizely Commerce Connect, you should look at the list of Spreedly-supported gateways.

After you select a gateway, note the following:

  • If an ERP or other third-party system needs payment tokens, such as to capture a payment after delivery, the gateway must support the Store operation. This should be listed under the Supported operations section for the payment gateway fact sheet. See the Stripe Payment Intents fact sheet as an example.
  • If the gateway requires 3DS2, the fact sheet displays Yes for Spreedly 3DS2 Global Support. This is what you configure in the Payment Service when adding a merchant profile and SCA provider. 

    3ds2 supported.png

    Gateway Specific 3DS2 Supported refers to the gateway's native 3DS2 support, which Payment Service does not support at this time.

  • All payment gateways are different and require a different implementation in Spreedly and the Payment Service. You should read the Spreedly gateway guide for the steps you must take with the gateway provider, either configurable by the payment portal or by contacting support, to turn certain features on or off.
  • Some gateways have gateway_specific_fields. This passes gateway custom information from Optimizely and the Payment Service to the payment gateway provider. You or your partner can fully customize the gateway-specific fields. For example, you could send the necessary order information to the ERP system from the payment gateway.

If the gateway intended to be used is not part of this list, contact Optimizely support.

Enable Payment Service

Configured Commerce

To use the Payment Service, contact Optimizely Support to have the keys for a Payment Service instance added to your commerce environment.

After the keys are added and you restart the site, you can see the admin pages for Payment Service to continue the configuration.

Commerce Connect

To use the Payment Service, contact your Customer Success Manager to have a Payment Service instance added to Turnstile. They can then provide the instance keys that must be added to appsetting.json in Commerce Connect after downloading the Optimizely.PaymentService.Client NuGet package.

"PaymentServiceOptions": {
			"PaymentServiceIsEnabled": true,
			"PaymentServiceUrl": "https://xxx.xxx/",
			"AppKey": "xxxxx”,
			"SecretKey": "xxxxx”,
			"AuthenticationType": "HMAC”,
			"EnvironmentKey": "xxx",
			"SigningSecret": "xxx",
			"EnvironmentName": "abc"
			}

The supported authentication types are HMAC and OBO.

If the EnvironmentKey is empty, provide an EnvironmentName and add the following code to the Configure function of the Setup.cs file. The environment was automatically established during start-up and running.

app.SetupPaymentService();

After the keys are added and you restart the site, you can see the admin pages for Payment Service to continue the configuration.

Commerce Connect gateway keys.png

Add gateways

  1. Go to Administration > Payment Service in Configured Commerce or Commerce Administration > Settings > Payment Service in Commerce Connect.
  2. Click Add Gateway.

    AddGateway.png

  3. Select the gateway from the drop-down list. The form populates additional fields depending on the gateway.
  4. (Optional) Enter a Description.
  5. (Optional) Select your Merchant Profile Key if you have already created a merchant profile.
  6. Select whether to use this gateway in your Sandbox Site.
  7. Fill in any additional information for your gateway.
  8. Click Create

Enable 3DS authentication

To enable 3DS authentication, create a merchant profile and an SCA provider. The merchant profile holds the SCA provider, which runs 3DS2 Global authentications on the authenticate endpoint or as part of authorize and purchase transactions.

You cannot perform a new 3DS authorization or sales transaction through the Admin Console in Configured Commerce.

Add a merchant profile

 Information for the merchant profile fields comes from your payment provider.

  1. Go to Administration > Payment Service > Merchant Profiles in Configured Commerce or Commerce Administration > Settings > Payment Service > Merchant Profiles.
  2. Click Add Merchant Profile.

    AddMerchantProfile.png

  3. (Optional) Enter a Description.
  4. Enter a Sub-Merchant Key.
  5. Select a credit card from the drop-down list.
  6. Enter the Acquirer Merchant ID.
  7. Enter the Merchant Name.
  8. Enter a Country Code.
  9. Enter the MCC. The MCC is the Merchant Category Code, which classifies the type of goods or services that the business sells. See Spreedly's documentation for information.
  10. Repeat steps 5-9 for all card types your site supports.
  11. Click Create.

Add an SCA provider

You must create a merchant profile first to add a Strong Customer Authentication (SCA) provider.

  1.  
    1. Go to Administration > Payment Service > SCA Providers in Configured Commerce or Commerce Administration > Settings > Payment Service > SCA Providers in Commerce Connect.
    2. Click Add SCA Provider.

      AddSCAProvider.png

    3. Select a Merchant Profile.
    4. Enter the Type.
    5. Select whether to use this SCA Provider in your sandbox.
    6. Select a Credit Card from the drop-down list.
    7. Enter the Acquirer BIN.
    8. Enter the Merchant Url.
    9. Enter the Merchant Brand Id.
    10. Enter the Merchant Password.
    11. Repeat steps 6-10 for all card types your site supports.
    12. Click Create. You can also click Cancel to exit without saving.

After you create the SCA provider, the SCA Provider Key displays. Copy this key because this is the only time this information is displayed. If you lose it, you must create another SCA provider.

Test 3DS integration

Before going to production, you should test your 3DS integration. See Testing your 3DS2 Global Integration in Spreedly's documentation for information. 

Enter credentials under settings

Configured Commerce

When you have completed the previous steps, go to Administration > Settings > Spreedly and enter the following information:

  1. Enter the gateway token from Add gateways. This can be website-specific.
  2. Toggle on 3DS Enabled.
  3. Enter the SCA Provider Key and Signing Secret from Add an SCA provider.

Commerce Connect

When you have completed the previous steps, go to Commerce Administration > Settings > Payments, click Create, and enter the following information:

Payment Method.png

  1. Enter the Name.
  2. Enter the System Keyword.
  3. Enter the Description.
  4. Select a Language.
  5. Select a Class Name.
  6. Select a Payment Class.
  7. Select whether to use this payment in IsActive.
  8. Select whether to use this payment in IsDefault.
  9. Click Save. You can also click Cancel to exit without saving.

Select the payment method you just created and go to the Parameters tab. Click Add parameter.

Payment Parameters.png

  1. Enter the parameter name as GatewayToken.
  2. Enter the parameter value with the key that was created.

    Add new parameter.png

  3. Click Save. You can also click Cancel to exit without saving.

Go to the payment method you just created. Go to Markets and select the active markets. Click Save if you made changes.

Martkets.png

If you want to use 3DS, create two parameters with the following:

  • ThreeDsIsEnabledTrue
  • ScaProviderKey – The key that was created

Click Save. You can also click Cancel to exit without saving.

You can create other methods and sort by IsActive, IsDefault then Ordering values.

Implement verify a card transaction type (optional)

Commerce's Payment Service supports the ability to verify a card when collecting payment information before the transaction occurs later. Custom development is required to adjust it per project. See Verifying a card in Spreedly's documentation for information.

How it works

The following flowchart demonstrates the payment service process during cart submission.

CartSubmitProcess.png

AVS and CVV gateway provisioning

Some Spreedly-supported payment gateways let you configure Address Verification System (AVS) and Card Verification Value (CVV) behavior through the APIs or merchant portal. See AVS and CVV gateway provisioning for Spreedly for information.