Merx

Options

production

Enables/disables production.

site/config/config.php

return [
  'ww.merx.production' => true,
];

If set to true paypal.live… and stripe.live… keys are used.

If set to false paypal.sandbox… and stripe.test keys are used.

Type

boolean

Default

false

license

return [
  'ww.merx.license' => 'MERX-XXXXXXXX-XXXXXXXX',
];

You need a valid license to make real purchases.

Type

string

currency

Currency string.

return [
  'ww.merx.currency' => 'GBP',
];

Used for Stripe Source and PayPal Payment.

Type

string

Default

EUR

currencySymbol

The Symbol of the desired currency.

return [
  'ww.merx.currencySymbol' => '£',
];

Type

string

Default

successPage

The page to be redirected after initializePayment

return [
  'ww.merx.successPage' => 'complete-order',
];

Used as the cancel_url and return_url for PayPal Payment.

Used as the return_url for Stripe Transaction.

Type

string

Default

success

ordersPage

The parent page of all order pages.

return [
  'ww.merx.ordersPage' => 'all-the-orders',
];

Type

string

Default

orders

stripe.test.publishable_key

return [
  'ww.merx.stripe.test.publishable_key' => 'pk_test_xxx…',
];

Type

string

stripe.test.secret_key

stripe.test.secret_key

return [
  'ww.merx.stripe.test.publishable_key' => 'sk_test_xxx…',
];

Type

string

stripe.live.publishable_key

return [
  'ww.merx.stripe.live.publishable_key' => 'pk_live_xxx…',
];

Type

string

stripe.live.secret_key

return [
  'ww.merx.stripe.live.publishable_key' => 'sk_live_xxx…',
];

Type

string

paypal.sandbox.clientID

return [
  'ww.merx.paypal.sandbox.clientID' => 'xxx…',
];

Type

string

paypal.sandbox.secret

return [
  'ww.merx.paypal.sandbox.secret' => 'xxx…',
];

Type

string

paypal.live.clientID

return [
  'ww.merx.paypal.live.clientID' => 'xxx…',
];

Type

string

paypal.live.secret

return [
  'ww.merx.paypal.live.secret' => 'xxx…',
];

Type

string

paypal.applicationContext

return [
  'ww.merx.paypal.applicationContext' => [
    'brand_name' => 'Beautiful Clothes Shop',
  ],
];

Type

array

Default applicationContext

If this option is not set the following is set as the application context.

$applicationContext = [
  'cancel_url' => url(option('ww.merx.successPage')),
  'return_url' => url(option('ww.merx.successPage')),
  'user_action' => 'PAY_NOW',
  'shipping_preference' => 'NO_SHIPPING',
  'brand_name' => (string)site()->title(),
];

gateways

Custom payment gateways.

return [
  'ww.merx.gateways' => [
    'my-payment-provider' => [
      'initializePayment' => function(OrderPage $virtualOrderPage): OrderPage
      {
        return $virtualOrderPage;
      },
      'completePayment' => function(OrderPage $virtualOrderPage): OrderPage
      {
        return $virtualOrderPage;
      },
    ],
  ],
];

More information in the Custom Payment Gateways Cookbook

Type

array