Skip to content

Commit 3cf2bcb

Browse files
committed
update example
- MarketplaceTest
1 parent 4fe36ba commit 3cf2bcb

File tree

3 files changed

+62
-13
lines changed

3 files changed

+62
-13
lines changed

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@
1717
"email": "[email protected]"
1818
}
1919
],
20-
"require": {}
20+
"require": {
21+
"ext-json": "*",
22+
"ext-openssl": "*",
23+
"ext-curl": "*"
24+
}
2125
}

example/MarketplaceTest.php

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ function register()
1919
$settlementBankAccount = new \Model\SettlementBankAccount();
2020
$settlementBankAccount->setBranchCode("1231");
2121
$settlementBankAccount->setRoutingNumber("12");
22+
$settlementBankAccount->setBankRegion("BR");
2223
$settlementBankAccount->setAccountType(\Model\AccountType::CHECKING);
23-
$settlementBankAccount->setAccountHolderTIN("1213214");
24+
$settlementBankAccount->setAccountHolderTIN("12345678901");
2425
$settlementBankAccount->setAccountHolderName("Timi");
2526
$settlementBankAccount->setBankAccountNo("121232141");
2627
$settlementBankAccount->setAccountHolderType(\Model\AccountHolderType::ENTERPRISE);
2728
$settlementInfo->setSettlementBankAccount($settlementBankAccount);
28-
$alipayRegisterRequest->setSettlementInfos($settlementInfo);
29+
$alipayRegisterRequest->setSettlementInfos([$settlementInfo]);
2930

3031

3132
$merchantInfo = new \Model\MerchantInfo();
32-
$merchantInfo->setLoginId("wangzunjiao[email protected]");
33+
$merchantInfo->setLoginId( round(microtime(true) * 1000)."wangzunj3ao[email protected]");
3334
$merchantInfo->setLegalEntityType(\Model\LegalEntityType::COMPANY);
3435

36+
3537
$company = new \Model\Company();
3638
$company->setLegalName("legalName");
3739
$address = new \Model\Address();
@@ -44,20 +46,26 @@ function register()
4446
$company->setOperatingAddress($address1);
4547

4648
$attachment = new \Model\Attachment();
47-
$attachment->setAttachmentName("attachmentName");
48-
$attachment->setAttachmentType(\Model\AttachmentType::ASSOCIATION_ARTICLE);
49+
$attachment->setAttachmentName("1.jpg");
50+
$attachment->setFileKey("test");
51+
$attachment->setAttachmentType(\Model\AttachmentType::ARTICLES_OF_ASSOCIATION);
52+
$attachment1 = new \Model\Attachment();
53+
$attachment1->setFileKey("23423tewgusdhghdsiughsud");
54+
$attachment1->setAttachmentType(\Model\AttachmentType::ASSOCIATION_ARTICLE);
55+
$attachment1->setAttachmentName("2.jpg");
4956
$company->setAttachments([$attachment]);
5057
$company->setOperatingAddress($address);
58+
5159
$certificate = new \Model\Certificate();
5260
$certificate->setCertificateNo("11321421");
5361
$certificate->setCertificateType(\Model\CertificateType::ENTERPRISE_REGISTRATION);
54-
$company->setCertificates([$certificate]);
62+
$company->setCertificates($certificate);
5563

5664
$merchantInfo->setCompany($company);
5765
$merchantInfo->setReferenceMerchantId(round(microtime(true) * 1000));
5866

5967
$businessInfo = new \Model\BusinessInfo();
60-
$businessInfo->setDoingBusinessAs("DoingBusinessAs");
68+
$businessInfo->setDoingBusinessAs("businessName_DBA");
6169
$webSite = new \Model\WebSite();
6270
$webSite->setUrl("www.alipay.com");
6371
$businessInfo->setWebsites([$webSite]);
@@ -66,24 +74,43 @@ function register()
6674
$entityAssociations = new \Model\EntityAssociations();
6775
$individual = new \Model\Individual();
6876
$certificate1 = new \Model\Certificate();
69-
$certificate1->setCertificateNo("11321421");
77+
$certificate1->setCertificateNo("11124321421");
7078
$certificate1->setCertificateType(\Model\CertificateType::CPF);
7179
$individual->setCertificates([$certificate1]);
7280
$userName = new \Model\UserName();
7381
$userName->setFirstName("firstName");
82+
$userName->setMiddleName("middleName");
7483
$userName->setLastName("lastName");
84+
$userName->setFullName("fullName");
7585
$individual->setName($userName);
7686
$individual->setDateOfBirth("1990-01-01");
7787
$entityAssociations->setIndividual($individual);
7888
$entityAssociations->setLegalEntityType(\Model\LegalEntityType::INDIVIDUAL);
89+
$entityAssociations->setAssociationType(\Model\AssociationType::LEGAL_REPRESENTATIVE);
90+
7991

80-
$merchantInfo->setEntityAssociations([$entityAssociations]);
92+
$entityAssociations1 = new \Model\EntityAssociations();
93+
$individual1 = new \Model\Individual();
94+
$certificate2 = new \Model\Certificate();
95+
$certificate2->setFileKeys(["wetrewqratewtewgewgewg"]);
96+
$certificate2->setCertificateNo("11321421");
97+
$certificate2->setCertificateType(\Model\CertificateType::CPF);
98+
$individual1->setCertificates([$certificate2]);
99+
$individual1->setName($userName);
100+
$individual1->setDateOfBirth("1990-01-01");
101+
$entityAssociations1->setIndividual($individual1);
102+
$entityAssociations1->setLegalEntityType(\Model\LegalEntityType::INDIVIDUAL);
103+
$entityAssociations1->setAssociationType(\Model\AssociationType::UBO);
104+
105+
106+
$merchantInfo->setEntityAssociations([$entityAssociations,$entityAssociations1]);
81107

82108
$alipayRegisterRequest->setMerchantInfo($merchantInfo);
83109

84110
$alipayClient = new DefaultAlipayClient("https://open-sea-global.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
85111
$alipayResponse = $alipayClient->execute($alipayRegisterRequest);
86112

113+
printf($alipayRegisterRequest->getMerchantInfo()->getReferenceMerchantId());
87114
echo json_encode($alipayResponse);
88115

89116
}
@@ -104,7 +131,7 @@ function update($referenceMerchantId)
104131
$settlementBankAccount->setAccountHolderType(\Model\AccountHolderType::ENTERPRISE);
105132
$alipaySettlementInfoUpdateRequest->setSettlementBankAccount($settlementBankAccount);
106133

107-
$alipayClient = new DefaultAlipayClient("https://open-sea-global.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
134+
$alipayClient = new DefaultAlipayClient("https://open-na.alipay.com", merchantPrivateKey, alipayPublicKey, clientId);
108135
$alipayResponse = $alipayClient->execute($alipaySettlementInfoUpdateRequest);
109136

110137
echo json_encode($alipayResponse);
@@ -211,6 +238,6 @@ function createTransfer()
211238
echo json_encode($alipayResponse);
212239
}
213240

214-
register();
215-
241+
//register();
242+
update("outmid_wangzunjiao_wzj_20240929_100432_437");
216243

model/EntityAssociations.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ class EntityAssociations
1111
public $individual;
1212
public $shareholdingRatio;
1313

14+
/**
15+
* @return mixed
16+
*/
17+
public function getAssociationType()
18+
{
19+
return $this->associationType;
20+
}
21+
22+
/**
23+
* @param mixed $associationType
24+
*/
25+
public function setAssociationType($associationType): void
26+
{
27+
$this->associationType = $associationType;
28+
}
29+
30+
31+
1432

1533
/**
1634
* @return mixed

0 commit comments

Comments
 (0)