-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
23 lines (20 loc) · 774 Bytes
/
test.php
File metadata and controls
23 lines (20 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
namespace SuperUserDev\PaymentAPI;
spl_autoload_register('spl_autoload');
set_include_path(dirname(__DIR__, 2));
$req = new PaymentRequest(
new BasicCardRequest(),
new DisplayItem('Label', new Amount(14.99)),
new DisplayItem('Label 2', new Amount(4.95)),
new Discount('$5 off', new Amount(5))
);
$shipping = new ShippingOption('ship', 'Shipping', new Amount(2));
$req->addShippingOptions($shipping, new ShippingOption('no-ship', 'Not used shipping', new Amount(100)));
$req->setShipping('no-ship');
$req->setTax(new Tax('Tax', new Amount(1)));
$req->setIncludeShipping(true);
$req->setIncludeTax(true);
$req->setRequestPayerName(true);
$req->setRequestPayerEmail(true);
$req->setRequestPayerPhone(true);
echo json_encode($req, JSON_PRETTY_PRINT) . PHP_EOL;