Example #1
0
 /**
  * Create an instance
  *
  * @since version 1.0.0
  * @access public
  * @return instance of self
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 *  but not limited to the warranties of merchantability, fitness for
 *  a particular purpose and non-infringement. In no event shall the
 *  authors or copyright holders be liable for any claim, damages or
 *  other liability, whether in an action of contract, tort or otherwise,
 *  arising from, out of or in connection with the software or the use
 *  of other dealings in the software.
 *
 */
// Define your ICEPAY Merchant ID and Secret code. The values below are sample values and will not work, Change them to your own merchant settings.
define('MERCHANTID', 'xxxxxx');
define('SECRETCODE', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
// Include the API into your project
require_once '../src/icepay_api_pbm.php';
try {
    /* Set the payment */
    $pbmObj = new Icepay_Pbm_Object();
    $pbmObj->setCurrency('EUR')->setAmount(200)->setCountry('NL')->setLanguage('NL')->setDescription('Test API')->setReference('API REFERENCE')->setOrderID('pbm1000001');
    // Order ID does not work yet.
    $pbm = Icepay_Api_Pbm::getInstance();
    $pbm->setMerchantID(MERCHANTID)->setSecretCode(SECRETCODE);
    $result = $pbm->createLink($pbmObj);
    if (true === $result->success) {
        echo $result->url;
    } else {
        echo $result->errorCode . '<br />';
        echo $result->errorMessage;
    }
} catch (Exception $e) {
    echo $e->getCode() . '<br />';
    echo $e->getMessage();
}