-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJoin.php
99 lines (80 loc) · 2.84 KB
/
Join.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
* Copyright notice:
* (c) Copyright 2018 RocketGate
* All rights reserved.
*
* The copyright notice must not be removed without specific, prior
* written permission from RocketGate.
*
* This software is protected as an unpublished work under the U.S. copyright
* laws. The above copyright notice is not intended to effect a publication of
* this work.
* This software is the confidential and proprietary information of RocketGate.
* Neither the binaries nor the source code may be redistributed without prior
* written permission from RocketGate.
*
* The software is provided "as-is" and without warranty of any kind, express, implied
* or otherwise, including without limitation, any warranty of merchantability or fitness
* for a particular purpose. In no event shall RocketGate be liable for any direct,
* special, incidental, indirect, consequential or other damages of any kind, or any damages
* whatsoever arising out of or in connection with the use or performance of this software,
* including, without limitation, damages resulting from loss of use, data or profits, and
* whether or not advised of the possibility of damage, regardless of the theory of liability.
*
* Purpose: This page uses the LinkBuilder util to build links to RG join pages
*
*/
//
// Include the Database and Postback Configs
//
require_once("rg_config.php");
//
// Include the LinkBuilder Class
//
include("LinkBuilder.php");
//
// These values must always be set.
//
$urlStuff = new LinkBuilder(RG_HASH_SECRET); // create a LinkBuilder Object
$urlStuff->Set("merch", RG_MERCHANT_ID);
$time = uniqueTimeStamp();
$urlStuff->Set("id", $time);
$urlStuff->Set("invoice", $time);
// Pass the Product ID in the prodid
if ( isset($_GET['prodid']) && strlen($_GET['prodid']) > 0) {
$urlStuff->Set("prodid", $_GET['prodid']);
if ( $_GET['prodid'] == 1) {
$urlStuff->Set("amount", 1.99);
} else if ( $_GET['prodid'] == 2) {
$urlStuff->Set("amount", 2.99);
$urlStuff->Set("rebill-freq", "MONTHLY");
} else if ( $_GET['prodid'] == 3) {
$urlStuff->Set("amount", 3.99);
$urlStuff->Set("rebill-freq", "60");
$urlStuff->Set("rebill-count", "0");
}
} else {
die("Missing Product ID. Please use valid join link from <a href=\"" . RG_MERCHANT_URL . "\">return to website</a>\n");
}
//
// this is required for a credit card transaction
//
$urlStuff->Set("method", "CC");
$urlStuff->Set("purchase", "TRUE");
//
// Get the encoded portion of the link
//
$str = $urlStuff->Encode();
//
// Establish which machine to send the request - put the link together
//
$link = RG_LINK . $str;
//
// Redirect user to join page link
//
//echo "<a href=\"" . $link . "\">Test</a>\n";
//
header('Cache-Control: no-cache');
header('Location: ' . $link);
?>