-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtpm_order_process.php
More file actions
executable file
·27 lines (20 loc) · 1.04 KB
/
tpm_order_process.php
File metadata and controls
executable file
·27 lines (20 loc) · 1.04 KB
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
<?php
require_once ('includes/token.php');
$item_id = $_POST['item_id'];
$name = $_POST['buy-name'];
$email = $_POST['buy-email'];
$quantity = $_POST['buy-quantity'];
if(isset($_POST['buy-address_line_1'])) {$address_line_1 = $_POST['buy-address_line_1'];} else {$address_line_1=null;}
if(isset($_POST['buy-postal_zip_code'])) {$postal_zip_code = $_POST['buy-postal_zip_code'];} else {$postal_zip_code=null;}
if(isset($_POST['buy-state_province'])) {$state_province = $_POST['buy-state_province'];} else {$state_province=null;}
if(isset($_POST['buy-city'])) {$city = $_POST['buy-city'];} else {$city=null;}
if(isset($_POST['buy-country'])) {$country = $_POST['buy-country'];} else {$country=null;}
$return_url = $_POST['item_page'];
$cancel_url = $_POST['item_page'];
try{
$tpm_create_order=$obj->createOrder($item_id, $name, $email, $address_line_1,'', $postal_zip_code, $state_province, $city, $country, '', $quantity, $return_url, $cancel_url , $tpmm_id);
}catch(Exception $e){
// tpm_debug($e);
}
header("Location: $tpm_create_order->paypal_url");
?>