-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.profileRequest.php
executable file
·33 lines (23 loc) · 1.16 KB
/
example.profileRequest.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
<?php
require __DIR__ . '/vendor/autoload.php';
require_once "ratepay_credentials.php";
/****************************************************
* The ProfileRequest requests the merchant profile *
****************************************************/
// ProfileRequest needs 'head' only
$mbHead = new RatePAY\ModelBuilder();
$mbHead->setArray([
'SystemId' => "Example",
'Credential' => [
'ProfileId' => PROFILE_ID,
'Securitycode' => SECURITYCODE
]
]);
$rb = new RatePAY\RequestBuilder(true); // Sandbox mode = true
$profileRequest = $rb->callProfileRequest($mbHead);
if (!$profileRequest->isSuccessful()) die("ConfigurationRequest not successful");
var_dump($profileRequest->getResult());
// The ProfileRequest response object provides no specific methods
/*********************************************************************************************************************************
* The library throws decidedly exceptions. It's recommended to surround model building and request calls with try-catch-blocks. *
*********************************************************************************************************************************/