-
-
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.
- Loading branch information
1 parent
6167676
commit cc17f1b
Showing
191 changed files
with
4,688 additions
and
1,350 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,3 @@ | ||
kind: Added | ||
body: Updated api specs | ||
time: 2024-02-21T11:43:12.907894501+01:00 |
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
func (c *Client) WithProjectKey(projectKey string) *ByProjectKeyRequestBuilder { | ||
return &ByProjectKeyRequestBuilder{ | ||
projectKey: projectKey, | ||
client: c, | ||
} | ||
} |
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,15 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
type ByProjectKeyRequestBuilder struct { | ||
projectKey string | ||
client *Client | ||
} | ||
|
||
func (rb *ByProjectKeyRequestBuilder) PaymentIntents() *ByProjectKeyPaymentIntentsRequestBuilder { | ||
return &ByProjectKeyPaymentIntentsRequestBuilder{ | ||
projectKey: rb.projectKey, | ||
client: rb.client, | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
checkout/client_payment_intents_by_project_key_payment_intents.go
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,16 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
type ByProjectKeyPaymentIntentsRequestBuilder struct { | ||
projectKey string | ||
client *Client | ||
} | ||
|
||
func (rb *ByProjectKeyPaymentIntentsRequestBuilder) WithPaymentId(paymentId string) *ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder { | ||
return &ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder{ | ||
paymentId: paymentId, | ||
projectKey: rb.projectKey, | ||
client: rb.client, | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
checkout/client_payment_intents_by_project_key_payment_intents_by_payment_id.go
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,28 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder struct { | ||
projectKey string | ||
paymentId string | ||
client *Client | ||
} | ||
|
||
/** | ||
* Specific Error Codes: | ||
* - [MultipleActionsNotAllowed](ctp:checkout:type:MultipleActionsNotAllowedError) | ||
* - [RequiredField](ctp:checkout:type:RequiredFieldError) | ||
* - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) | ||
* | ||
*/ | ||
func (rb *ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder) Post(body Payment) *ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost { | ||
return &ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost{ | ||
body: body, | ||
url: fmt.Sprintf("/%s/payment-intents/%s", rb.projectKey, rb.paymentId), | ||
client: rb.client, | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
checkout/client_payment_intents_by_project_key_payment_intents_by_payment_id_post.go
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,76 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"io/ioutil" | ||
"net/http" | ||
"net/url" | ||
) | ||
|
||
type ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost struct { | ||
body Payment | ||
url string | ||
client *Client | ||
headers http.Header | ||
} | ||
|
||
func (r *ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost) Dump() map[string]interface{} { | ||
return map[string]interface{}{ | ||
"url": r.url, | ||
} | ||
} | ||
|
||
func (rb *ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost { | ||
rb.headers = headers | ||
return rb | ||
} | ||
|
||
/** | ||
* Specific Error Codes: | ||
* - [MultipleActionsNotAllowed](ctp:checkout:type:MultipleActionsNotAllowedError) | ||
* - [RequiredField](ctp:checkout:type:RequiredFieldError) | ||
* - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) | ||
* | ||
*/ | ||
func (rb *ByProjectKeyPaymentIntentsByPaymentIdRequestMethodPost) Execute(ctx context.Context) (result *interface{}, err error) { | ||
data, err := serializeInput(rb.body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
queryParams := url.Values{} | ||
resp, err := rb.client.post( | ||
ctx, | ||
rb.url, | ||
queryParams, | ||
rb.headers, | ||
data, | ||
) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
content, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer resp.Body.Close() | ||
switch resp.StatusCode { | ||
case 200: | ||
err = json.Unmarshal(content, &result) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return result, nil | ||
default: | ||
result := GenericRequestError{ | ||
StatusCode: resp.StatusCode, | ||
Content: content, | ||
Response: resp, | ||
} | ||
return nil, result | ||
} | ||
|
||
} |
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,52 @@ | ||
package checkout | ||
|
||
// Generated file, please do not change!!! | ||
|
||
/** | ||
* The Region in which the Checkout application is [hosted](/../checkout/installing-checkout#regions-and-hosts). | ||
* | ||
*/ | ||
type Region string | ||
|
||
const ( | ||
RegionEuropeWest1Gcp Region = "europe-west1.gcp" | ||
RegionUsCentral1Gcp Region = "us-central1.gcp" | ||
RegionAustraliaSoutheast1Gcp Region = "australia-southeast1.gcp" | ||
) | ||
|
||
/** | ||
* The amount related to a [payment action](ctp:checkout:type:PaymentAction). | ||
* | ||
*/ | ||
type Amount struct { | ||
// Amount in the smallest indivisible unit of a currency, such as: | ||
// | ||
// * Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`). | ||
// * The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`). | ||
CentAmount int `json:"centAmount"` | ||
// Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | ||
CurrencyCode string `json:"currencyCode"` | ||
} | ||
|
||
/** | ||
* The possible values for a [payment action](ctp:checkout:type:PaymentAction). | ||
* | ||
*/ | ||
type PaymentOperation string | ||
|
||
const ( | ||
PaymentOperationCapturePayment PaymentOperation = "capturePayment" | ||
PaymentOperationRefundPayment PaymentOperation = "refundPayment" | ||
PaymentOperationCancelPayment PaymentOperation = "cancelPayment" | ||
) | ||
|
||
/** | ||
* Depending on the action specified, Checkout requests the [Payment Service Provider](/../checkout/configuring-checkout#supported-payment-service-providers) to capture, refund, or cancel the authorization for the given Payment. | ||
* | ||
*/ | ||
type PaymentAction struct { | ||
// Action to execute for the given Payment. | ||
Action PaymentOperation `json:"action"` | ||
// Amount to be captured or refunded. | ||
Amount *Amount `json:"amount,omitempty"` | ||
} |
Oops, something went wrong.