Skip to content

Commit 19ffda7

Browse files
committed
add example
- DisputeTest
1 parent 3cf2bcb commit 19ffda7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

example/DisputeTest.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
require '../init.php';
4+
5+
use Client\DefaultAlipayClient;
6+
7+
8+
const clientId = "";
9+
const merchantPrivateKey = "";
10+
const alipayPublicKey = "";
11+
const gatewayUrl = "";
12+
13+
14+
function acceptDispute($disputeId)
15+
{
16+
$alipayAcceptDisputeRequest = new \Request\dispute\AlipayAcceptDisputeRequest();
17+
$alipayAcceptDisputeRequest->setDisputeId($disputeId);
18+
19+
$alipayClient = new DefaultAlipayClient("https://open-sea-global.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
20+
$alipayResponse = $alipayClient->execute($alipayAcceptDisputeRequest);
21+
22+
echo json_encode($alipayResponse);
23+
}
24+
25+
26+
function supplyDefenseDocument($disputeId)
27+
{
28+
$alipaySupplyDefenseDocumentRequest = new \Request\dispute\AlipaySupplyDefenseDocumentRequest();
29+
$alipaySupplyDefenseDocumentRequest->setDisputeId($disputeId);
30+
$alipaySupplyDefenseDocumentRequest->setDisputeEvidence("test");
31+
32+
$alipayClient = new DefaultAlipayClient("https://open-sea-global.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
33+
$alipayResponse = $alipayClient->execute($alipaySupplyDefenseDocumentRequest);
34+
35+
echo json_encode($alipayResponse);
36+
}
37+
38+
39+
function downloadDisputeEvidence($disputeId)
40+
{
41+
$alipayDownloadDisputeEvidenceRequest = new \Request\dispute\AlipayDownloadDisputeEvidenceRequest();
42+
$alipayDownloadDisputeEvidenceRequest->setDisputeId($disputeId);
43+
$alipayDownloadDisputeEvidenceRequest->setDisputeEvidenceType(\Model\DisputeEvidenceType::DISPUTE_EVIDENCE_TEMPLATE);
44+
45+
$alipayClient = new DefaultAlipayClient("https://open-sea-global.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
46+
$alipayResponse = $alipayClient->execute($alipayDownloadDisputeEvidenceRequest);
47+
48+
echo json_encode($alipayResponse);
49+
}

0 commit comments

Comments
 (0)