-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathEcommerce.php
45 lines (38 loc) · 1.22 KB
/
Ecommerce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @package ImpressPages
*/
namespace Ip;
class Ecommerce
{
public function subscriptionPaymentUrl($options)
{
if (empty($options['item'])) {
throw new \Ip\Exception('"item" setting is missing in subscriptionPaymentUrl function');
}
$paymentUrl = ipJob('ipSubscriptionPaymentUrl', $options);
return $paymentUrl;
}
public function subscriptionCancelUrl($options)
{
if (empty($options['item'])) {
throw new \Ip\Exception('"item" setting is missing in subscriptionCancelUrl function');
}
$cancelUrl = ipJob('ipSubscriptionCancelUrl', $options);
return $cancelUrl;
}
public function paymentUrl($options)
{
if (empty($options['id'])) {
throw new \Ip\Exception('"id" setting is missing in paymentUrl function');
}
if (empty($options['price'])){
throw new \Ip\Exception('"price" setting is missing in paymentUrl function');
}
if (empty($options['currency'])) {
throw new \Ip\Exception('"currency" setting is missing in paymentUrl function');
}
$paymentUrl = ipJob('ipPaymentUrl', $options);
return $paymentUrl;
}
}