Skip to content

Computop

Computop provides two payment button providers that route through the Computop payment gateway.

Computop:GooglePay

Renders a Google Pay button where gateway is fixed to 'computop' internally.

Options — ComputopGooglePayOptions

Based on GooglePayOptions with the following fields removed (Computop enforces them internally):

  • gateway — always 'computop'
  • billingAddressRequired — always true
  • billingAddressParameters — always { format: 'FULL', phoneNumberRequired: true }
FieldTypeRequiredDefaultDescription
totalAmountnumberYesAmount in minor units
currencyCodestringYesISO 4217 uppercase currency code
gatewayMerchantIdstringYesMerchant ID at Computop
countryCodestringNoISO 3166-1 alpha-2 merchant country code
merchantIdstringNoGoogle Pay merchant ID (required in production)
merchantNamestringNoMerchant name in payment sheet
allowedCardNetworksstring[]No['AMEX','DISCOVER','INTERAC','JCB','MASTERCARD','VISA']Accepted card networks
allowedCardAuthMethodsstring[]No['PAN_ONLY','CRYPTOGRAM_3DS']Accepted auth methods
emailRequiredbooleanNofalseRequest buyer's email
shippingAddressRequiredbooleanNofalseRequest shipping address
callbackIntentsstring[]No['PAYMENT_AUTHORIZATION']Google Pay callback intents

Example

html
<div id="computop-googlepay-container"></div>
js
import { ExpressButtons } from 'collana-pay-js';

const buttons = ExpressButtons({
  providers: [
    {
      providerProtocolType: 'Computop',
      paymentMethodType: 'GooglePay',
      container: '#computop-googlepay-container',
      style: {
        buttonColor: 'black',
        buttonType: 'buy',
        buttonSizeMode: 'fill',
      },
      options: {
        totalAmount: 19300,       // €193.00
        currencyCode: 'EUR',
        countryCode: 'DE',
        gatewayMerchantId: 'mac_test',
        merchantName: 'My Shop',
        emailRequired: true,
      },
    },
  ],

  onClick: async (identity, paymentMethodData) => {
    const res = await fetch('/api/orders', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ provider: identity, paymentMethodData }),
    });
    const order = await res.json();
    return { orderId: order.id };
  },

  onApprove: (data) => {
    window.location.href = `/order/success?id=${data.orderId}`;
  },

  onCancel: (identity) => {
    console.log('Computop Google Pay cancelled', identity);
  },

  onError: (error) => {
    console.error('Computop Google Pay error', error);
  },
});

buttons.render();

Computop:ApplePay

Renders an Apple Pay button via the Computop gateway using the W3C Payment Request API.

Requirement: HTTPS and Apple Pay domain validation are required. See Known Constraints — Apple Pay Requires HTTPS.

Options — ComputopApplePayOptions

Identical to ApplePayOptions. All fields are fully configurable.

FieldTypeRequiredDefaultDescription
totalAmountnumberYesAmount in minor units
currencyCodestringYesISO 4217 currency code
countryCodestringYesISO 3166-1 alpha-2 merchant country code
merchantIdentifierstringYesApple Pay merchant identifier
merchantDisplayNamestringYesDisplayed in the Apple Pay sheet
validateMerchantUrlstringYesBackend URL for merchant session validation
supportedNetworksstring[]No['amex','discover','masterCard','visa']Accepted card networks
billingAddressRequiredbooleanNofalseRequest billing address
shippingAddressRequiredbooleanNofalseRequest shipping address
requestPayerNamebooleanNotrueRequest payer's name
requestPayerEmailbooleanNotrueRequest payer's email
requestPayerPhonebooleanNotrueRequest payer's phone

Example

html
<div id="computop-applepay-container"></div>
js
{
  providerProtocolType: 'Computop',
  paymentMethodType: 'ApplePay',
  container: '#computop-applepay-container',
  style: { buttonstyle: 'black', type: 'buy' },
  options: {
    totalAmount: 19300,
    currencyCode: 'EUR',
    countryCode: 'DE',
    merchantIdentifier: 'merchant.com.myshop',
    merchantDisplayName: 'My Shop',
    validateMerchantUrl: 'https://api.myshop.com/applepay/validate-merchant',
    billingAddressRequired: true,
  },
}

CollanaPay SDK Documentation