-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix test assert to allow beta versions (#1478) * Codegen for openapi v157 (#1477) * Bump version to 72.115.0 * Use the generated API version (#1482) * Use the generated API version 2 * remove comment * API Updates (#1481) * API Updates (#1484) * Bump version to 72.116.0 * Document use of undocumented parameters/properties (#1483) * Document use of undocumented parameters/properties * Correcting function call Copied over the dotnet function (i think). Resolving that error. * Update README.md Co-authored-by: Dominic Charley-Roy <[email protected]> * Update README.md Co-authored-by: Dominic Charley-Roy <[email protected]> Co-authored-by: Dominic Charley-Roy <[email protected]> * Add feature/** and release/** to PR CI triggers (#1486) * Add feature/** and release/** to PR CI triggers * Remove extra stuff * Rename release to sdk-release in CI triggers * API Updates (#1487) * Bump version to 72.117.0 * Set version to 72.117.0 to simplify merge * Reset version to 72.115.0-beta.1 * Codegen for openapi v161 Co-authored-by: Kamil Pajdzik <[email protected]> Co-authored-by: Kamil Pajdzik <[email protected]> Co-authored-by: yejia-stripe <[email protected]> Co-authored-by: Dominic Charley-Roy <[email protected]> Co-authored-by: Dominic Charley-Roy <[email protected]> Co-authored-by: rmanzer-stripe <[email protected]>
- Loading branch information
1 parent
2efb19b
commit c1979ac
Showing
20 changed files
with
1,719 additions
and
1,418 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
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 +1 @@ | ||
v158 | ||
v161 |
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 |
---|---|---|
|
@@ -370,7 +370,47 @@ c, _ := charge.Retrieve("ch_123", p) | |
c.Customer.ID // ID is still available | ||
c.Customer.Name // Name is now also available (if it had a value) | ||
``` | ||
### How to use undocumented parameters and properties | ||
|
||
stripe-go is a typed library and it supports all public properties or parameters. | ||
|
||
Stripe sometimes launches private beta features which introduce new properties or parameters that are not immediately public. These will not have typed accessors in the stripe-go library but can still be used. | ||
|
||
#### Parameters | ||
|
||
To pass undocumented parameters to Stripe using stripe-go you need to use the `AddExtra()` method, as shown below: | ||
|
||
```go | ||
|
||
params := &stripe.CustomerParams{ | ||
Email: stripe.String("[email protected]") | ||
} | ||
|
||
params.AddExtra("secret_feature_enabled", "true") | ||
params.AddExtra("secret_parameter[primary]","primary value") | ||
params.AddExtra("secret_parameter[secondary]","secondary value") | ||
|
||
customer, err := customer.Create(params) | ||
``` | ||
|
||
#### Properties | ||
|
||
You can access undocumented properties returned by Stripe by querying the raw response JSON object. An example of this is shown below: | ||
|
||
```go | ||
customer, _ = customer.Get("cus_1234", nil); | ||
|
||
var rawData map[string]interface{} | ||
_ = json.Unmarshal(customer.LastResponse.RawJSON, &rawData) | ||
|
||
secret_feature_enabled, _ := string(rawData["secret_feature_enabled"].(bool)) | ||
|
||
secret_parameter, ok := rawData["secret_parameter"].(map[string]interface{}) | ||
if ok { | ||
primary := secret_parameter["primary"].(string) | ||
seconardy := secret_parameter["secondary"].(string) | ||
} | ||
``` | ||
### Writing a Plugin | ||
|
||
If you're writing a plugin that uses the library, we'd appreciate it if you | ||
|
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
Oops, something went wrong.