-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprefill_api_integration.php
More file actions
85 lines (74 loc) · 2.32 KB
/
prefill_api_integration.php
File metadata and controls
85 lines (74 loc) · 2.32 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
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
<?php
/*
* Set path to the BluePayOnlineApp.php helper script.
*/
include_once('BluePayOnlineApp.php');
/*
* Set these values before running script.
* The short app hash value here applies to one specific short form,
* however, you can use any valid short form hash here.
*
* Example: /interfaces/create_form/shortapp/<HASH GOES HERE>
*
*/
const BASE_URL = 'https://onlineapp.bluepay.com/';
const YOUR_SHORT_APP = 'GET HASH FROM YOUR BLUEPAY INTEGRATION SUPPORT REPRESENTATIVE';
const USER_ID = 'ENTER API ACCOUNT ID HERE';
const USER_ACCESS_KEY = 'ENTER BLUEVIEW ACCESS KEY HERE';
$your_shortapp = BASE_URL.'interfaces/create_form/shortapp/'.YOUR_SHORT_APP;
$bluepay = new \BluePayOnlineAppPrefillApi;
$bluepay->setSecretKey(USER_ACCESS_KEY)
->setApiAccountId(USER_ID)
->setUrl(BASE_URL.'interfaces/create_form/api/prefill');
$prefill_id = $bluepay->create();
$params = [
'bn_dba'=>'BluePay Widgets Inc.',
'bn_location_contact_fname'=>'Billy',
'bn_location_contact_lname'=>'Merchant',
'bn_location_address'=>'184 Shuman Blvd',
'sfs_accept_only'=>'yes',
'bn_location_city'=>'Naperville',
'bn_location_state'=>'IL',
'bn_location_zip'=>'60502',
'bn_location_phone_number_1'=>'800-214-6978',
'mp_type_of_business'=>'Retail' ,
'mp_average_ticket'=>'100' ,
'mp_expected_card_sales_mo'=>'2000',
'mp_type_of_goods_sold'=>'Widgets',
'si_transit_aba'=>'111000025',
'si_deposit_account_number'=>'987987987',
'mp_email'=>'test@bluepay.com',
'mp_website'=> 'https://www.bluepay.com',
'oi_owner_1_ssn_1'=>'322-54-6789',
'oi_owner_1_fname'=>'Billys',
'oi_owner_1_lname'=>'Merchants',
'oi_owner_1_title' => 'President',
'sfs_non_pci_compliance_fee'=>'15.00',
'ci_tax_filing_name'=>'Billy Q Merchant',
'ci_fed_tax_id'=>'9999999',
'mp_max_ticket' => '599',
'ci_ownership_type'=>'LLC'
];
$response = $bluepay->setParams($params)->update($prefill_id);
/*
* View operation.
* $response = $bluepay->view($prefill_id);
*/
$foo = <<<EOF
<html>
<head>
</head>
<body>
<section id="content1" class="section">
<div class="onlineappForm">
<iframe width="100%" height="3700px" frameborder="0" allowTransparency="true" src="
EOF;
$foo .= $your_shortapp.'?prefillid='.$prefill_id;
$foo .= <<<EOF
"></iframe>
</div>
</section>
</body>
EOF;
echo $foo;
exit();