<?php
/*
*

 ______   _______  __   __  _______  _______  ___   _______ 
|      | |       ||  |_|  ||       ||       ||   | |       |
|  _    ||    ___||       ||   _   ||_     _||   | |       |
| | |   ||   |___ |       ||  | |  |  |   |  |   | |       |
| |_|   ||    ___||       ||  |_|  |  |   |  |   | |      _|
|       ||   |___ | ||_|| ||       |  |   |  |   | |     |_ 
|______| |_______||_|   |_||_______|  |___|  |___| |_______|
 _______  __   __  _______                                  
|       ||  |_|  ||       |                                 
|       ||       ||  _____|                                 
|       ||       || |_____                                  
|      _||       ||_____  |                                 
|     |_ | ||_|| | _____| |                                 
|_______||_|   |_||_______|                                                   
                                              
                                           
*
*
*/

/**
 * Demotic CMS is a fork of ImpressPages.
 * AUTHOR: Demotic
 * @package Demotic
 */


namespace Demotic;


class Ecommerce
{
    public function subscriptionPaymentUrl($options)
    {
        if (empty($options['item'])) {
            throw new \Demotic\Exception('"item" setting is missing in subscriptionPaymentUrl function');
        }
        $paymentUrl = ipJob('ipSubscriptionPaymentUrl', $options);
        return $paymentUrl;
    }

    public function subscriptionCancelUrl($options)
    {
        if (empty($options['item'])) {
            throw new \Demotic\Exception('"item" setting is missing in subscriptionCancelUrl function');
        }
        $cancelUrl = ipJob('ipSubscriptionCancelUrl', $options);
        return $cancelUrl;
    }

    public function paymentUrl($options)
    {
        if (empty($options['id'])) {
            throw new \Demotic\Exception('"id" setting is missing in paymentUrl function');
        }
        if (empty($options['price'])){
            throw new \Demotic\Exception('"price" setting is missing in paymentUrl function');
        }
        if (empty($options['currency'])) {
            throw new \Demotic\Exception('"currency" setting is missing in paymentUrl function');
        }
        $paymentUrl = ipJob('ipPaymentUrl', $options);
        return $paymentUrl;
    }

}
