-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.php
80 lines (64 loc) · 1.82 KB
/
example.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
<pre>
<?
/*
* secpay.php
*
* PHP Secpay
* Some functions to help connect to Paypoint / Secpay's XMLRPC API.
*
* Requires: Zend Framework v1.8 or later
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2010 Paul Maunders (http://www.pyrosoft.co.uk/blog/)
*/
require_once "config.php";
require_once 'Zend/XmlRpc/Client.php';
require_once "secpay.php";
// Example use of the ValidateCardFull function (to set up a new payment)
$options['test_status']='true';
$options['dups']='true';
$options['currency']='GBP';
//$options['mail_merchants']='youremail@example.com';
//$options['mail_attach_merchant']='true';
$options['usage_type']='R';
$options['cv2']='123';
$transaction_id = 'TEST_1_'.rand();
$result = ValidateCardFull(
$transaction_id, // trans_id - Transaction ID
'123.123.123.123', // ip - IP Address
'mr test test', // name - Cardholder Name
'4444333322221111', // card_number - Card Number
'1', // amount - Amount to charge
'0712', // expiry_date - Card Expiry Date
'', // card_type
$options, // options - Optional Parameters
'0', // issue_number - Card Issue Number
'0309', // start_date - Card Start Date
'', // order - Order Details
'', // shipping - Shipping Address Details
'' // billing - Billing Address Details
);
var_dump($result);
// Example use of the RepeatCardFullAddr function (for repeat payments)
$options['test_status']='true';
$options['usage_type']='R';
$result = RepeatCardFullAddr(
$transaction_id,
'2',
$transaction_id.'_REPEAT_'.time(),
$exp_date="",
$order ="",
$shipping ="",
$billing ="",
$options
);
var_dump($result);
// Example use of the RefundCardFull function (for refunding payments)
$result = RefundCardFull(
$transaction_id,
1,
$transaction_id.'_REFUND_'.time()
);
var_dump($result);
?>