-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.php
39 lines (32 loc) · 1.25 KB
/
test.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
<?php
require 'vendor/autoload.php';
use macropage\SDKs\ebay\rest\fulfillment\Configuration;
use macropage\SDKs\ebay\rest\fulfillment\Model\IssueRefundRequest;
use macropage\SDKs\ebay\rest\fulfillment\Api\OrderApi;
$Configuration = new Configuration();
$Configuration->setAccessToken('v^1.1..........');
$Configuration->setDebug(true);
$Configuration->setDebugFile('/app/debug.txt');
$apiInstance = new OrderApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$Configuration
);
try {
$result = $apiInstance->getOrder($argv[1]);
/** @noinspection ForgottenDebugOutputInspection */
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrderApi->getOrder: ', $e->getMessage(), PHP_EOL;
}
try {
$issueRefundRequest = new IssueRefundRequest();
$issueRefundRequest->setComment('this is a comment');
$issueRefundRequest->setReasonForRefund('BUYER_CANCEL');
$result = $apiInstance->issueRefund($argv[1], $issueRefundRequest);
/** @noinspection ForgottenDebugOutputInspection */
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrderApi->getOrder: ', $e->getMessage(), PHP_EOL;
}