-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from omise/add_partial_capture_support
Add partial capture support
- Loading branch information
Showing
5 changed files
with
169 additions
and
21 deletions.
There are no files selected for viewing
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,10 @@ | ||
package omise | ||
|
||
// AuthorizationType represents an enumeration of a possible authorization type of a Charge object. | ||
type AuthorizationType string | ||
|
||
// AuthorizationType can be one of the following list of constants: | ||
const ( | ||
PreAuth AuthorizationType = "pre_auth" | ||
FinalAuth AuthorizationType = "final_auth" | ||
) |
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
99 changes: 99 additions & 0 deletions
99
testdata/fixtures/api.omise.co/charges/chrg_test_5x1753iuub61dfe41q4-get.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,99 @@ | ||
{ | ||
"object": "charge", | ||
"id": "chrg_test_5x1753iuub61dfe41q4", | ||
"location": "/charges/chrg_test_5x1753iuub61dfe41q4", | ||
"amount": 10000, | ||
"authorization_type": "pre_auth", | ||
"authorized_amount": 10000, | ||
"captured_amount": 5000, | ||
"net": 4804, | ||
"fee": 183, | ||
"fee_vat": 13, | ||
"interest": 0, | ||
"interest_vat": 0, | ||
"funding_amount": 5000, | ||
"refunded_amount": 0, | ||
"transaction_fees": { | ||
"fee_flat": "0.0", | ||
"fee_rate": "3.65", | ||
"vat_rate": "7.0" | ||
}, | ||
"platform_fee": { | ||
"fixed": null, | ||
"amount": null, | ||
"percentage": null | ||
}, | ||
"currency": "THB", | ||
"funding_currency": "THB", | ||
"ip": null, | ||
"refunds": { | ||
"object": "list", | ||
"data": [], | ||
"limit": 20, | ||
"offset": 0, | ||
"total": 0, | ||
"location": "/charges/chrg_test_5x1753iuub61dfe41q4/refunds", | ||
"order": "chronological", | ||
"from": "1970-01-01T00:00:00Z", | ||
"to": "2023-09-24T16:13:56Z" | ||
}, | ||
"link": null, | ||
"description": null, | ||
"metadata": {}, | ||
"card": { | ||
"object": "card", | ||
"id": "card_test_5x1753cc9r2wkffypp0", | ||
"livemode": false, | ||
"location": "/customers/cust_test_5x1753g3i8l4tt93k8e/cards/card_test_5x1753cc9r2wkffypp0", | ||
"deleted": false, | ||
"street1": null, | ||
"street2": null, | ||
"city": "Bangkok", | ||
"state": null, | ||
"phone_number": null, | ||
"postal_code": "10320", | ||
"country": "us", | ||
"financing": "credit", | ||
"bank": "JPMORGAN CHASE BANK N.A.", | ||
"brand": "Visa", | ||
"fingerprint": "ZmYHTfxzcB4xH5GTzXaPWRRpScr5nGNEDaPJ2XYJQfw=", | ||
"first_digits": null, | ||
"last_digits": "4242", | ||
"name": "JOHN DOE", | ||
"expiration_month": 2, | ||
"expiration_year": 2024, | ||
"security_code_check": true, | ||
"tokenization_method": null, | ||
"created_at": "2023-09-07T16:36:42Z" | ||
}, | ||
"source": null, | ||
"schedule": null, | ||
"customer": "cust_test_5x1753g3i8l4tt93k8e", | ||
"dispute": null, | ||
"transaction": "trxn_test_5x1753qdm0bdrsbrugd", | ||
"failure_code": null, | ||
"failure_message": null, | ||
"status": "successful", | ||
"authorize_uri": null, | ||
"return_uri": null, | ||
"created_at": "2023-09-07T16:36:43Z", | ||
"paid_at": "2023-09-07T16:36:43Z", | ||
"expires_at": "2023-09-14T16:36:43Z", | ||
"expired_at": "2023-09-14T16:36:43Z", | ||
"reversed_at": null, | ||
"zero_interest_installments": false, | ||
"branch": null, | ||
"terminal": null, | ||
"device": null, | ||
"authorized": true, | ||
"capturable": false, | ||
"capture": false, | ||
"disputable": true, | ||
"livemode": false, | ||
"refundable": true, | ||
"reversed": false, | ||
"reversible": false, | ||
"voided": false, | ||
"paid": true, | ||
"expired": false | ||
} |