-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_checkout.php
44 lines (39 loc) · 1.75 KB
/
test_checkout.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
<?php
include(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php');
try {
$response = $api->order->test_checkout(array(
# string name of the recipient (required)
'name' => NAME,
# string email of the recipient (required)
'email' => EMAIL,
# string first line of street address (required)
'address_1' => ADDRESS_1,
# string second line of street address (optional)
'address_2' => null,
# string city (required)
'city' => CITY,
# string region/state/province (required)
'region' => REGION,
# string postcode (required)
'postcode' => POSTCODE,
# string 2-char country code (required)
'country' => COUNTRY,
# string payment processor - paypal or stripe (required)
'payment_processor' => PAYMENT_PROCESSOR,
# string URL address (required, if $payment_processor is paypal)
'return_url' => RETURN_URL,
# string stripe token (required, if $payment_processor is stripe)
'stripe_token' => STRIPE_TOKEN,
# int numeric ID of the product (required)
'item1_product_id' => ITEM1_PRODUCT_ID,
# string colour ID (required)
'item1_colour_id' => ITEM1_COLOUR_ID,
# string size (required)
'item1_size' => ITEM1_SIZE,
# int quantity to order (required)
'item1_quantity' => ITEM1_QUANTITY,
));
debug($response);
} catch (Exception $e) {
echo $e->getMessage();
}