Reformatted code and added support for all payment methods

This commit adds the following payment methods:
- EPS
- Giftcards
- Giropay
- ING Home'Pay
- KBC/CBC

I've also ran a reformatter to clean up the code and added composer
instead of git modules. The latter enables us to keep up-to-date
with the last Mollie library in a more modern manner.
This commit is contained in:
Wouter van Os
2018-09-12 20:29:20 +02:00
parent 7bd9cb9340
commit 27d3ae1745
23 changed files with 661 additions and 129 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.idea/
src/mollie/vendor/

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "src/mollie/vendor/Mollie"]
path = src/mollie/vendor/Mollie
url = https://github.com/mollie/mollie-api-php.git

8
composer.json Normal file
View File

@@ -0,0 +1,8 @@
{
"require": {
"mollie/mollie-api-php": "^2.0"
},
"config": {
"vendor-dir": "src/mollie/vendor"
}
}

387
composer.lock generated Normal file
View File

@@ -0,0 +1,387 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cf5ed5a56673041dedb10fab56defab1",
"packages": [
{
"name": "composer/ca-bundle",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
"reference": "46afded9720f40b9dc63542af4e3e43a1177acb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0",
"reference": "46afded9720f40b9dc63542af4e3e43a1177acb0",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-pcre": "*",
"php": "^5.3.2 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
"psr/log": "^1.0",
"symfony/process": "^2.5 || ^3.0 || ^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\CaBundle\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
"keywords": [
"cabundle",
"cacert",
"certificate",
"ssl",
"tls"
],
"time": "2018-08-08T08:57:40+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.3-dev"
}
},
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22T15:46:56+00:00"
},
{
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
},
{
"name": "guzzlehttp/psr7",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2017-03-20T17:10:46+00:00"
},
{
"name": "mollie/mollie-api-php",
"version": "v2.0.13",
"source": {
"type": "git",
"url": "https://github.com/mollie/mollie-api-php.git",
"reference": "8d3b199ddf955f968a274daa1d2a4bdf68b932d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/8d3b199ddf955f968a274daa1d2a4bdf68b932d1",
"reference": "8d3b199ddf955f968a274daa1d2a4bdf68b932d1",
"shasum": ""
},
"require": {
"composer/ca-bundle": "^1.1",
"ext-curl": "*",
"ext-json": "*",
"ext-openssl": "*",
"guzzlehttp/guzzle": "^6.3",
"php": ">=5.6"
},
"require-dev": {
"eloquent/liberator": "^2.0",
"phpunit/phpunit": "^5.7|^6.5|^7.1"
},
"suggest": {
"mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information."
},
"type": "library",
"autoload": {
"psr-4": {
"Mollie\\Api\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Mollie B.V.",
"email": "info@mollie.com"
}
],
"description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.",
"homepage": "https://www.mollie.com/en/developers",
"keywords": [
"CBC",
"api",
"bancontact",
"banktransfer",
"belfius",
"belfius direct net",
"bitcoin",
"charges",
"creditcard",
"direct debit",
"fashioncheque",
"gateway",
"gift cards",
"ideal",
"inghomepay",
"intersolve",
"kbc",
"mistercash",
"mollie",
"payment",
"payments",
"paypal",
"paysafecard",
"podiumcadeaukaart",
"recurring",
"refunds",
"sepa",
"service",
"sofort",
"sofortbanking",
"subscriptions"
],
"time": "2018-08-29T09:05:31+00:00"
},
{
"name": "psr/http-message",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

View File

@@ -5,7 +5,7 @@
*
*/
require_once __DIR__ . '/../../../init.php';
require_once __DIR__ . '/vendor/Mollie/src/Mollie/API/Autoloader.php';
require_once __DIR__ . '/vendor/autoload.php';
$whmcs->load_function('gateway');
$whmcs->load_function('invoice');
@@ -31,9 +31,6 @@ if(isset($_POST['id'])) {
$method = $transaction['method'];
if ($method === Mollie_API_Object_Method::MISTERCASH) {
$method = 'bancontact';
}
$_GATEWAY = getGatewayVariables('mollie' . $method . '_devapp');
@@ -50,7 +47,7 @@ if(isset($_POST['id'])) {
$transactionCurrency = mysql_fetch_assoc($transactionCurrency);
// Check payment
$mollie = new Mollie_API_Client;
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey($_GATEWAY['key']);
$payment = $mollie->payments->get($_POST['id']);

View File

@@ -13,7 +13,12 @@ $_GATEWAYLANG['payWithBelfius'] = 'Betaal met Belfius';
$_GATEWAYLANG['payWithBitcoin'] = 'Betaal met Bitcoin';
$_GATEWAYLANG['payWithCreditcard'] = 'Betaal met Creditcard';
$_GATEWAYLANG['payWithIdeal'] = 'Betaal met iDeal';
$_GATEWAYLANG['payWithMistercash'] = 'Betaal met Bancontact';
$_GATEWAYLANG['payWithBancontact'] = 'Betaal met Bancontact';
$_GATEWAYLANG['payWithPaypal'] = 'Betaal met PayPal';
$_GATEWAYLANG['payWithPaysafecard'] = 'Betaal met Paysafecard';
$_GATEWAYLANG['payWithSofort'] = 'Betaal met Sofort Banking';
$_GATEWAYLANG['payWithEps'] = 'Betaal met EPS';
$_GATEWAYLANG['payWithGiftcard'] = 'Betaal met een cadeaukaart';
$_GATEWAYLANG['payWithGiropay'] = 'Betaal met Giropay';
$_GATEWAYLANG['payWithInghomepay'] = 'Betaal met ING Home\'Pay';
$_GATEWAYLANG['payWithKbc'] = 'Betaal met KBC/CBC-betaalknop';

View File

@@ -14,7 +14,12 @@ $_GATEWAYLANG['payWithBelfius'] = 'Pay with Belfius';
$_GATEWAYLANG['payWithBitcoin'] = 'Pay with Bitcoin';
$_GATEWAYLANG['payWithCreditcard'] = 'Pay with Credit Card';
$_GATEWAYLANG['payWithIdeal'] = 'Pay with iDeal';
$_GATEWAYLANG['payWithMistercash'] = 'Pay with Bancontact';
$_GATEWAYLANG['payWithBancontact'] = 'Pay with Bancontact';
$_GATEWAYLANG['payWithPaypal'] = 'Pay with PayPal';
$_GATEWAYLANG['payWithPaysafecard'] = 'Pay with Paysafecard';
$_GATEWAYLANG['payWithSofort'] = 'Pay with Sofort Banking';
$_GATEWAYLANG['payWithEps'] = 'Pay with EPS';
$_GATEWAYLANG['payWithGiftcard'] = 'Pay with a gift card';
$_GATEWAYLANG['payWithGiropay'] = 'Pay with Giropay';
$_GATEWAYLANG['payWithInghomepay'] = 'Pay with ING Home\'Pay';
$_GATEWAYLANG['payWithKbc'] = 'Pay with KBC/CBC Payment Button';

View File

@@ -1,19 +1,21 @@
<?php
require_once __DIR__ . '/vendor/Mollie/src/Mollie/API/Autoloader.php';
require_once __DIR__ . '/vendor/autoload.php';
function mollie_config() {
function mollie_config()
{
return array(
'key' => array(
'FriendlyName' => 'API key',
'Type' => 'text',
'Size' => '35',
'Description' => 'Your channel\'s API key.'
'Description' => 'Your channels API key.'
)
);
}
function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL) {
function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL)
{
global $whmcs;
/**
@@ -42,7 +44,7 @@ function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL) {
full_query('CREATE TABLE IF NOT EXISTS `gateway_mollie` (`id` int(11) NOT NULL AUTO_INCREMENT, `paymentid` varchar(15), `amount` double NOT NULL, `currencyid` int(11) NOT NULL, `ip` varchar(50) NOT NULL, `userid` int(11) NOT NULL, `invoiceid` int(11) NOT NULL, `status` ENUM(\'open\',\'paid\',\'closed\') NOT NULL DEFAULT \'open\', `method` VARCHAR(25) NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `paymentid` (`paymentid`)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;');
}
$mollie = new Mollie_API_Client;
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey($params['key']);
/**
@@ -84,7 +86,10 @@ function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL) {
));
$payment = $mollie->payments->create(array(
'amount' => $params['amount'],
'amount' => [
'value' => $params['amount'],
'currency' => $params['currency'],
],
'method' => $method,
'description' => $params['description'],
'redirectUrl' => $params['returnurl'] . '&check_payment=' . $transactionId,
@@ -97,19 +102,19 @@ function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL) {
update_query('gateway_mollie', array('paymentid' => $payment->id), array('id' => $transactionId));
header('Location: ' . $payment->getPaymentUrl());
header('Location: ' . $payment->getCheckoutUrl());
exit();
} else {
$return = '<form action="" method="POST">';
if ($method == Mollie_API_Object_Method::IDEAL) {
if ($method == \Mollie\Api\Types\PaymentMethod::IDEAL) {
$issuers = $mollie->issuers->all();
$return .= '<label for="issuer">' . $_GATEWAYLANG['selectBank'] . ':</label> ';
$return .= '<select name="issuer">';
foreach ($issuers as $issuer) {
if ($issuer->method == Mollie_API_Object_Method::IDEAL) {
if ($issuer->method == \Mollie\Api\Types\PaymentMethod::IDEAL) {
$return .= '<option value=' . htmlspecialchars($issuer->id) . '>' . htmlspecialchars($issuer->name) . '</option>';
}
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliebancontact_devapp_config() {
function molliebancontact_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliebancontact_devapp_config() {
return $config;
}
function molliebancontact_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::MISTERCASH);
function molliebancontact_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::BANCONTACT);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliebanktransfer_devapp_config() {
function molliebanktransfer_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliebanktransfer_devapp_config() {
return $config;
}
function molliebanktransfer_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::BANKTRANSFER);
function molliebanktransfer_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::BANKTRANSFER);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliebelfius_devapp_config() {
function molliebelfius_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliebelfius_devapp_config() {
return $config;
}
function molliebelfius_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::BELFIUS);
function molliebelfius_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::BELFIUS);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliebitcoin_devapp_config() {
function molliebitcoin_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliebitcoin_devapp_config() {
return $config;
}
function molliebitcoin_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::BITCOIN);
function molliebitcoin_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::BITCOIN);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliecreditcard_devapp_config() {
function molliecreditcard_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliecreditcard_devapp_config() {
return $config;
}
function molliecreditcard_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::CREDITCARD);
function molliecreditcard_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::CREDITCARD);
}

22
src/mollieeps_devapp.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
require_once __DIR__ . '/mollie/mollie.php';
function mollieeps_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
'FriendlyName' => array(
'Type' => 'System',
'Value' => 'Mollie EPS'
)
));
return $config;
}
function mollieeps_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::EPS);
}

View File

@@ -0,0 +1,22 @@
<?php
require_once __DIR__ . '/mollie/mollie.php';
function molliegiftcard_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
'FriendlyName' => array(
'Type' => 'System',
'Value' => 'Mollie Giftcard'
)
));
return $config;
}
function molliegiftcard_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::GIFTCARD);
}

View File

@@ -0,0 +1,22 @@
<?php
require_once __DIR__ . '/mollie/mollie.php';
function molliegiropay_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
'FriendlyName' => array(
'Type' => 'System',
'Value' => 'Mollie Giropay'
)
));
return $config;
}
function molliegiropay_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::GIROPAY);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function mollieideal_devapp_config() {
function mollieideal_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function mollieideal_devapp_config() {
return $config;
}
function mollieideal_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::IDEAL);
function mollieideal_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::IDEAL);
}

View File

@@ -0,0 +1,22 @@
<?php
require_once __DIR__ . '/mollie/mollie.php';
function mollieinghomepay_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
'FriendlyName' => array(
'Type' => 'System',
'Value' => 'Mollie ING Home\'Pay'
)
));
return $config;
}
function mollieinghomepay_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::INGHOMEPAY);
}

22
src/molliekbc_devapp.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
require_once __DIR__ . '/mollie/mollie.php';
function molliekbc_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
'FriendlyName' => array(
'Type' => 'System',
'Value' => 'Mollie KBC/CBC Payment Button'
)
));
return $config;
}
function molliekbc_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::KBC);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliepaypal_devapp_config() {
function molliepaypal_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliepaypal_devapp_config() {
return $config;
}
function molliepaypal_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::PAYPAL);
function molliepaypal_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::PAYPAL);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliepaysafecard_devapp_config() {
function molliepaysafecard_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliepaysafecard_devapp_config() {
return $config;
}
function molliepaysafecard_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::PAYSAFECARD);
function molliepaysafecard_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::PAYSAFECARD);
}

View File

@@ -2,7 +2,8 @@
require_once __DIR__ . '/mollie/mollie.php';
function molliesofort_devapp_config() {
function molliesofort_devapp_config()
{
$config = mollie_config();
$config = array_merge($config, array(
@@ -15,6 +16,7 @@ function molliesofort_devapp_config() {
return $config;
}
function molliesofort_devapp_link($params) {
return mollie_link($params, Mollie_API_Object_Method::SOFORT);
function molliesofort_devapp_link($params)
{
return mollie_link($params, \Mollie\Api\Types\PaymentMethod::SOFORT);
}