-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add missing request params * Restore old sonar organization * Revert "Restore old sonar organization" This reverts commit 3631241. * Revert "Revert "Restore old sonar organization"" This reverts commit bbf5fe7. * Update Card test * Update charge request test * Update customer tests * Update recipient tests * Update source test
- Loading branch information
1 parent
1118ed5
commit 9514ff1
Showing
13 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
bin/test/testdata/fixtures/api.omise.co/recipients-post.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"object": "recipient", | ||
"id": "recp_test_50894vc13y8z4v51iuc", | ||
"livemode": false, | ||
"location": "/recipients/recp_test_50894vc13y8z4v51iuc", | ||
"verified": true, | ||
"active": true, | ||
"name": "[email protected]", | ||
"email": "[email protected]", | ||
"description": "Default recipient", | ||
"type": "individual", | ||
"tax_id": null, | ||
"bank_account": { | ||
"object": "bank_account", | ||
"brand": "test", | ||
"last_digits": "6789", | ||
"name": "JOHN DOE", | ||
"created_at": "2015-06-02T09:26:59Z", | ||
"account_number": "1111" | ||
}, | ||
"failure_code": null, | ||
"created_at": "2015-06-02T09:26:59Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,14 @@ public void testCreate() throws IOException, OmiseException { | |
Request<Customer> request = new Customer.CreateRequestBuilder() | ||
.email("[email protected]") | ||
.description("John Doe (id: 30)") | ||
.linkedAccount("acc_id") | ||
.build(); | ||
|
||
Customer customer = getTestRequester().sendRequest(request); | ||
|
||
assertRequested("POST", "/customers", 200); | ||
assertRequestBody("{\"card\":null,\"description\":\"John Doe (id: 30)\",\"email\":\"[email protected]\",\"metadata\":null,\"linked_account\":\"acc_id\"}"); | ||
|
||
|
||
assertEquals("customer", customer.getObject()); | ||
assertEquals(CUSTOMER_ID, customer.getId()); | ||
|
@@ -44,10 +47,12 @@ public void testGet() throws IOException, OmiseException { | |
public void testUpdate() throws IOException, OmiseException { | ||
Request<Customer> request = new Customer.UpdateRequestBuilder(CUSTOMER_ID) | ||
.email("[email protected]") | ||
.linkedAccount("acc_id") | ||
.build(); | ||
Customer customer = getTestRequester().sendRequest(request); | ||
|
||
assertRequested("PATCH", "/customers/" + CUSTOMER_ID, 200); | ||
assertRequestBody("{\"email\":\"[email protected]\",\"linked_account\":\"acc_id\"}"); | ||
|
||
assertEquals(CUSTOMER_ID, customer.getId()); | ||
assertEquals("[email protected]", customer.getEmail()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ public void testCreate() throws IOException, OmiseException { | |
assertEquals(RECIPIENT_ID, recipient.getId()); | ||
assertEquals("[email protected]", recipient.getEmail()); | ||
assertEquals("6789", recipient.getBankAccount().getLastDigits()); | ||
assertEquals("1111", recipient.getBankAccount().getAccountNumber()); | ||
assertEquals("Default recipient", recipient.getDescription()); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,13 +35,16 @@ public void testCreate() throws IOException, OmiseException { | |
.expiration(YearMonth.now().plusYears(1)) | ||
.securityCode("123") | ||
.city("Bangkok") | ||
.postalCode("10240")) | ||
.postalCode("10240") | ||
.email("[email protected]") | ||
) | ||
.build(); | ||
|
||
Token token = getTestRequester().sendRequest(request); | ||
|
||
assertRequested("POST", "/tokens", 200); | ||
assertVaultRequest(); | ||
assertRequestBody("{\"card\":{\"city\":\"Bangkok\",\"country\":null,\"name\":\"JOHN DOE\",\"number\":\"4242424242424242\",\"state\":null,\"street1\":null,\"street2\":null,\"email\":\"[email protected]\",\"expiration_month\":9,\"expiration_year\":2025,\"phone_number\":null,\"postal_code\":\"10240\",\"security_code\":\"123\"}}"); | ||
|
||
assertEquals(TOKEN_ID, token.getId()); | ||
assertFalse(token.isLiveMode()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters