-
Notifications
You must be signed in to change notification settings - Fork 0
/
newURL.php
66 lines (61 loc) · 1.77 KB
/
newURL.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
Docs: https://docs.scanpay.dev/payment-link
support@scanpay.dk || irc.scanpay.dev:6697 #support
*/
require dirname(__FILE__) . '/../lib/Scanpay.php';
$apikey = '1153:YHZIUGQw6NkCIYa3mG6CWcgShnl13xuI7ODFUYuMy0j790Q6ThwBEjxfWFXwJZ0W';
$scanpay = new Scanpay\Scanpay($apikey);
$options = [
'hostname' => 'api.scanpay.dev',
'headers' => [
'X-Cardholder-IP' => '192.168.1.1',
],
];
$order = [
'orderid' => 'a766409',
'language' => 'da',
'successurl' => 'https://docs.scanpay.dev/payment-link',
'items' => [
[
'name' => 'Pink Floyd: The Dark Side Of The Moon',
'quantity' => 2,
'total' => '199.99 DKK',
'sku' => 'fadf23',
], [
'name' => '巨人宏偉的帽子',
'quantity' => 2,
'total' => '420 DKK',
'sku' => '124',
],
],
'billing' => [
'name' => 'John Doe',
'company' => 'The Shop A/S',
'email' => 'john@doe.com',
'phone' => '+4512345678',
'address' => ['Langgade 23, 2. th'],
'city' => 'Havneby',
'zip' => '1234',
'state' => '',
'country' => 'DK',
'vatin' => '35413308',
'gln' => '7495563456235',
],
'shipping' => [
'name' => 'Jan Dåh',
'company' => 'The Choppa A/S',
'email' => 'jan@doh.com',
'phone' => '+4587654321',
'address' => ['Langgade 23, 1. th', 'C/O The Choppa'],
'city' => 'Haveby',
'zip' => '1235',
'state' => '',
'country' => 'DK',
],
];
try {
print_r($newURL = $scanpay->newURL($order, $options) . "\n");
} catch (Exception $e) {
die($e->getMessage() . "\n");
}