Last updated

Walley Checkout Adapter

Overview Document: Payment Adapters Overview

Overview and Unique Capabilities

The Walley Checkout Adapter integrates Walley Checkout with Norce Checkout. This page focuses on the unique technical details and configuration for Walley.

Supported payment methods and other features: Features Overview

Configuration in Norce Admin

The adapter is configured using the following unique details obtained from Walley:

FieldDescriptionExample Value
apiUrlWalley Checkout API URL (test or production).https://api.uat.walleydev.com
authenticationUrlWalley OAuth authentication URL.https://api.uat.walleydev.com
frontEndUrlWalley frontend URL for the checkout iframe loader script.https://checkout.uat.walleydev.com
scopeWalley OAuth scope (environment-specific constant). UAT: 705798e0-8cef-427c-ae00-6023deba29af/.default, Production: a3f3019f-2be9-41cc-a254-7bb347238e89/.default705798e0-8cef-427c-ae00-6023deba29af/.default
clientIdYour Walley client identifier.your-client-id
apiSecretYour Walley API secret key.your-api-secret

Store ID Configuration

Configure Store IDs for each country and customer type combination:

FieldDescription
storeId-SE-B2CStore ID for Sweden B2C customers
storeId-SE-B2BStore ID for Sweden B2B customers
storeId-NO-B2CStore ID for Norway B2C customers
storeId-NO-B2BStore ID for Norway B2B customers
storeId-FI-B2CStore ID for Finland B2C customers
storeId-FI-B2BStore ID for Finland B2B customers
storeId-DK-B2CStore ID for Denmark B2C customers
storeId-DK-B2BStore ID for Denmark B2B customers

Feature Toggles

FieldDescriptionDefault
useDeliveryModuleEnable Walley Delivery Module for integrated shipping.false
useCustomerPrefillEnable customer information prefill for returning customers.false
profileNameWalley profile name for customized checkout experience (configured by Walley Merchant Services).
useUpsellEnable upsell offers to be added to a completed Walley Checkout order. When enabled, orders eligible for upsell remain in Accepted state instead of Completed, allowing reauthorization before capture.false
upsellTimeoutSecondsMaximum time window in seconds during which upsell offers can be added before completing the order.300

Redirect URLs

Configure the URLs that Walley uses for callbacks and redirects:

FieldDescriptionExample Value
merchantTermsUriURL to merchant terms displayed and linked in the checkout.https://example.com/terms
redirectPageUriURI to redirect to after checkout completion.https://example.com/confirmation
notificationUriURI for Walley notification callbacks (order completion).https://{slug}.api-se.norce.tech/checkout/walley-adapter
validationUriURI for Walley validation callbacks (pre-purchase validation).https://{slug}.api-se.norce.tech/checkout/walley-adapter
checkoutAbortedRedirectPageUriURI to redirect to if checkout is aborted.https://example.com/checkout-aborted

Styling Options

Customize the appearance of the Walley Checkout iframe:

FieldDescriptionExample Value
dataPaddingSet to none to cancel out the left and right padding inside the iframe (by adjusting its margins and width).none
dataContainerIdID of an element on the page where the iframe will render instead of immediately above the script element.walley-checkout-container
dataActionColorHexadecimal color code for the background color of call-to-action buttons. Button text color is automatically set based on WCAG 2.0 contrast requirements.#582f87
dataActionTextColorOverride the automatic text color of call-to-action buttons. Valid values: black, white, #000000, #ffffff.#FFFFFF

Mapping Options

Configure how order data is mapped to Walley:

FieldDescriptionDefault
referenceSourceSelects the order property mapped to Walley Merchant Reference. Options: orderId, cartReference.orderId
shippingReferenceSourceSelects the shipping property mapped to Walley Shipping Fee ID. Options: ShippingId, CustomValue.ShippingId
customShippingReferenceCustom value for shipping reference (required when shippingReferenceSource is CustomValue).
mapDiscountPerRowIf true, applied discounts are included directly in item row prices instead of being represented as separate discount order lines.false

Localization Options

Configure localized text for discounts and vouchers:

FieldDescriptionExample Value
discountTextLocalized discount text by culture code.{"sv-SE": "Rabatt", "en-US": "Discount"}
voucherTextLocalized voucher text by culture code.{"sv-SE": "Presentkort", "en-US": "Gift Card"}

Frontend Integration Requirements

Required Client-Side Event Handling

Walley will not inform the Norce adapter directly of customer changes made through the Walley checkout widget. When a user enters or updates their customer information in the Walley widget, the widget triggers client-side events. You must listen for these events and call the Norce Walley Adapter API to update the order in real-time.

Failure to implement these event handlers will result in:

  • Email-based discounts not being validated correctly
  • Customer information not being synchronized with Norce until purchase completion
  • Potential order validation failures when the order is locked during payment processing

Required Event: Customer Update

Before implementing the Walley Checkout customer update event handler, ensure you have:

  • The Walley Checkout script loaded on your page
  • A valid Norce Checkout order ID and payment ID
  • Your Norce merchant and channel identifiers
  • A valid Norce authentication token (Bearer token)

Listen for the walleyCheckoutCustomerUpdated event from Walley and call the customer update endpoint:

// Initialize Walley event listener (after the Walley checkout script loads)
window.addEventListener('walleyCheckoutCustomerUpdated', async function(data) {
  const orderId = /* your order ID */;
  const paymentId = /* your payment ID */;
  const merchant = /* your merchant ID */;
  const channel = /* your channel ID */;
  const token = /* your authentication token */;

  await fetch(`/api/checkout/v1/callback/orders/${orderId}/payments/${paymentId}/customer-update`, {
    method: 'POST',
    headers: {
      'x-merchant': merchant,
      'x-channel': channel,
      'Authorization': 'Bearer ' + token
    }
  });
});

Endpoint:

POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/customer-update

This endpoint updates the Norce order with the latest customer information from Walley, including email address (critical for discount validation), billing address, delivery address, and loyalty membership data.

Failure to implement this event handler will result in:

  • Email-based discounts not being validated correctly
  • Customer information not being synchronized with Norce until purchase completion
  • Potential order validation failures when the order is locked during payment processing

Required Event: Shipping Option Update

When using Walley's delivery module (useDeliveryModule enabled), listen for shipping option changes to keep the Norce order synchronized:

window.addEventListener('walleyCheckoutShippingOptionUpdated', async function(data) {
  const orderId = /* your order ID */;
  const paymentId = /* your payment ID */;
  const merchant = /* your merchant ID */;
  const channel = /* your channel ID */;
  const token = /* your authentication token */;

  await fetch(`/api/checkout/v1/callback/orders/${orderId}/payments/${paymentId}/shipping-option-update`, {
    method: 'POST',
    headers: {
      'x-merchant': merchant,
      'x-channel': channel,
      'Authorization': 'Bearer ' + token
    }
  });
});

Endpoint:

POST /api/checkout/v1/callback/orders/{order_id}/payments/{payment_id}/shipping-option-update

This endpoint updates the Norce order with the selected shipping option from Walley, including shipping method, shipping cost, and delivery address.

Failure to implement this event handler will result in:

  • Shipping costs not being synchronized with Norce until purchase completion
  • Order totals being incorrect due to mismatched shipping prices
  • Potential order validation failures when the order is locked during payment processing
  • Customer experiencing unexpected price differences between Walley and the order confirmation
No Request Body Required

The customer-update and shipping-option-update endpoints do not require a request body. The adapter fetches the current session state directly from Walley when called.

Walley Checkout UI Locking During Payment Processing

When the customer initiates payment (clicks the purchase button), your checkout frontend should enter a locked state where:

  • All form inputs are disabled
  • Shipping options cannot be changed
  • Cart modifications are prevented
  • A loading indicator is displayed

This prevents race conditions where the customer might modify the order while payment is being processed, which can cause validation failures or unexpected order states.

For more details on Walley client-side events, see the Walley Checkout Client Events documentation.

Loyalty Integration

The Walley adapter automatically captures loyalty membership data from Walley orders. No configuration is required to enable this feature.

When a completed Walley order includes a loyaltyMembership on the customer object, the adapter reads this value and stores it as a Norce customer attribute with the key walleyCustomerLoyaltyMembership.

Unlike other features such as useDeliveryModule or useUpsell, there is no feature toggle for loyalty — the capture happens passively whenever Walley provides membership data on the order.

Walley API Environments

In addition to the generic Norce Adapter URLs (see Payment Adapters Overview), Walley uses the following external API environments:

EnvironmentWalley API Base URLWalley Frontend URL
Productionhttps://api.walleypay.comhttps://checkout.walleypay.com
Test (UAT)https://api.uat.walleydev.comhttps://checkout.uat.walleydev.com

Idempotency and Retries

Walley may send multiple notification callbacks for the same event. The adapter handles idempotency to ensure that duplicate notifications do not result in duplicate order processing. For detailed information about Walley's retry behavior, see the Walley Checkout documentation on Idempotency and retries.

Troubleshooting (Walley Specific)

In addition to the generic troubleshooting steps:

  • Review the order status directly in Walley's merchant portal.
  • If Capture fails, verify the Norce order is in the reserved state and that the Walley order status allows capture.
  • If Refund fails, ensure the order has been captured and has not already been returned.
  • Use the refresh call to update available payment actions:
POST /api/order/v1/orders/{order_id}/payments/{payment_id}/refresh
Host: {slug}.api-se.norce.tech
x-merchant: {merchant}
x-channel: {channel}
Authorization: Bearer {token}