GithubHelp home page GithubHelp logo

onpay_whmcs's Introduction

OnPay WHMCS Module

This module implements the OnPay payment gateway into WHMCS.

Supported features

  • Allow customer to pay using the card both for new and recurring items (reuse the card).
  • Set the payment window design from OnPay
  • Allow charging the card through WHMCS admin
  • Allow refunds through WHMCS admin
  • Allows multiple gateway IDs, window designs, secrets and api keys.

TODO:

  • Implement MobilePay subscriptions when OnPay supports it.

Not implemented

  • Deleting a card from WHMCS will not delete the subscription (remote token) at OnPay. WHMCS does not currently implement a function or hook on card deletion that would allow this functionality to be added.
  • Calculating the card fees.

Requirements

  • OnPay Subscription addon (99 DKK/month).
  • WHMCS 7.9 or newer

Installation

1: Copy files into modules/gateways:

onpay.php -> modules/gateways/onpay.php
onpay -> modules/gateways/onpay
callback/onpay.php -> modules/gateways/callbacks/onpay.php

2: Language files can be found in lang/overrides, and can be copied/merged to the corresponding lang/overrides directory in WHMCS.

3: Activate the module in System Settings -> Payment Gateways

4: Configure the module as per the instructions in the settings page.

4.1: Window Design is not required, it will simply default to the normal OnPay layout.

Handling multiple settlement currencies

There's cases where you want to handle multiple OnPay.io merchant accounts, e.g. when having multiple settlement currencies with Clearhaus which results in two API keys on the clearhaus side, which then in turn, also requires two OnPay.io merchant accounts.

To address this, the configuration is flexible to accommodate this. In its simplest form you can simply set the default configuration, as you'd normally do for gatewayID, windowDesign, windowSecret and apiKey, this will apply globally across all transactions.

A basic configuration example is as follows:

gatewayID: 3021017461000000
windowDesign: customWindow
windowSecret: XXXXXXXXXXXX
apiKey: XXXXXXXXXXXX

However, we can also control this per currency using the format DEFAULT:XXXX,CURRENCY_CODE:YYYY. This will be matched against the currency set on the client's account, so if we have DEFAULT:XXXX,USD:YYYY defined, and a customer pays in USD, we'll use the YYYY value, however if the customer pays in DKK or EUR, we'll use XXXX as the value, since that's the configured fallback value.

As a small example:

gatewayID: DEFAULT:3021017461000000,DKK:3021017461000001,EUR:3021017461000002
windowDesign: DEFAULT:customWindow,DKK:dkkWindow
windowSecret: DEFAULT:XXXXXXXXXXXX,DKK:YYYYYYYYYYY,EUR:ZZZZZZZZZZZZZZ
apiKey: DEFAULT:XXXXXXXXXXXX,DKK:YYYYYYYYYYY,EUR:ZZZZZZZZZZZZZZ

Here we change gatewayID depending on DEFAULT, DKK and EUR, but for windowDesign we only change it for DEFAULT and DKK (so EUR will use DEFAULT).

If you're defining currencies without DEFAULT, we'll use the first currency in the list. For a list of accepted currencies, you can look at https://onpay.io/docs/technical/index.html#accepted-currencies.

onpay_whmcs's People

Contributors

lucasrolff avatar ebbesmoeller avatar jhavedk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.