Exemple #1
0
<?php

include 'config/config.php';
include 'controllers/gatewayController.php';
$gateways = new gatewayController();
$selection = $gateways->getGateways();
?>

<div id="body-wrapper">
  <div id="main-menu">
    <div id="container">
      <a id="logo" href="https://www.multisafepay.com/">
        <img class="logo" src="assets/images/multisafepay-logo-white.svg" alt="MultiSafepay">
      </a>
      <div style="clear:both;"></div>
    </div>
  </div>
  <div id="main-wrapper">
    <div id="container">
      <div class="content-description left-align">
        <h1 class="black">You have selected gateway request.</h1>
        <br />

        <p>Normally, a gateway request is done to request all gateways active within your MultiSafepay account, based on currency, locale and amount. The request is done in the background, the returned gateways should be added to your checkout process within your store so that customers can use those payment methods to pay their order.</p>
        <br>
        <br />
        <p>Please select the payment method of your choice and start your transaction</p>
        <form action="<?php 
echo BASE_URL;
?>
controllers/gatewayController.php" method="GET">
Exemple #2
0
<?php

//autoload
require_once dirname(__FILE__) . "/../models/API/Autoloader.php";
//load config
if (file_exists("config/config.php")) {
    include "config/config.php";
} else {
    include "../config/config.php";
}
$ideal = new gatewayController();
if (isset($_GET['gateway'])) {
    $ideal->startTransaction($_GET['gateway']);
}
class gatewayController
{
    private $api_key = '';
    private $api_url = '';
    function __construct()
    {
        $this->api_key = API_KEY;
        $this->api_url = API_URL;
    }
    function getGateways()
    {
        $msp = new Client();
        $msp->setApiKey($this->api_key);
        $msp->setApiUrl($this->api_url);
        try {
            $query_string = 'country=NL&currency=USD&amount=1000&locale=nl-NL';
            $gateways = $msp->gateways->get($endpoint = 'gateways', $type = '', array(), $query_string);