-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PP-12141: Improve API request examples (#952)
* Improves some API examples * Minor fixes * Changes from @charleemg review * Update source/optional_features/welsh_language/index.html.md.erb Co-authored-by: ChristinaKyriakou <[email protected]> * Changes based on @ChristinaKyriakou review * Removes needless parameter from an example --------- Co-authored-by: ChristinaKyriakou <[email protected]>
- Loading branch information
1 parent
39f8d5f
commit 6af0d3f
Showing
6 changed files
with
95 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,38 +34,20 @@ You must send the following parameters in your request body when creating a paym | |
|
||
This example request creates a £145 council tax payment: | ||
|
||
```javascript | ||
```json | ||
{ | ||
"amount": 14500, | ||
"reference" : "12345", | ||
"description": "Pay your council tax", | ||
"return_url": "https://your.service.gov.uk/completed", | ||
"delayed_capture": false, | ||
"metadata": { | ||
"ledger_code": "AB100", | ||
"an_internal_reference_number": 200 | ||
}, | ||
"email": "[email protected]", | ||
"prefilled_cardholder_details": { | ||
"cardholder_name": "Sherlock Holmes", | ||
"billing_address": { | ||
"line1": "221 Baker Street", | ||
"line2": "Flat b", | ||
"postcode": "NW1 6XE", | ||
"city": "London", | ||
"country": "GB" | ||
} | ||
}, | ||
"language": "en", | ||
... | ||
"return_url": "https://your.service.gov.uk/completed" | ||
} | ||
``` | ||
|
||
Depending on your integration, you can also: | ||
|
||
* [delay taking a payment](/delayed_capture) | ||
* [prefill some of the fields on the user's payment page](/optional_features/prefill_user_details/) | ||
* [add custom metadata to a payment](/reporting/#add-additional-information-your-users-will-not-be-able-to-see-39-custom-metadata-39-or-39-reporting-columns-39) | ||
* [add custom metadata to a payment](/reporting/#add-more-information-to-a-payment-39-custom-metadata-39-or-39-reporting-columns-39) | ||
* [use Welsh on your payment pages](/optional_features/welsh_language/) | ||
* [take the payment over the phone](/moto_payments) | ||
|
||
|
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 |
---|---|---|
|
@@ -16,37 +16,43 @@ To prefill fields, include the following optional parameters in the API request | |
- `email` | ||
- `prefilled_cardholder_details` - with optional `cardholder_name` and `billing_address` parameters | ||
|
||
For example: | ||
|
||
```javascript | ||
"email": "[email protected]", | ||
"prefilled_cardholder_details": { | ||
"cardholder_name": "Sherlock Holmes", | ||
"billing_address": { | ||
This example request creates a £100 fine and prefills the user's email address, billing address, and the cardholder name: | ||
|
||
```json | ||
{ | ||
"amount": 10000, | ||
"reference" : "54321", | ||
"description": "Pay a fine you've been issued.", | ||
"return_url": "https://your.service.gov.uk/completed", | ||
"email": "[email protected]", | ||
"prefilled_cardholder_details": { | ||
"cardholder_name": "Sherlock Holmes", | ||
"billing_address": { | ||
"line1": "221 Baker Street", | ||
"line2": "Flat b", | ||
"postcode": "NW1 6XE", | ||
"city": "London", | ||
"country": "GB" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
All the parameters in `billing_address` are optional, and these parameters' values must be no longer than: | ||
All the parameters in `billing_address` are optional and must have values no longer than: | ||
|
||
- 254 characters for `email` | ||
- 255 characters for `cardholder_name` | ||
- 255 characters each for `line1`, `line2` and `city` in `billing_address` | ||
- 25 characters for `postcode` in `billing_address` | ||
|
||
If you include the `country` parameter, it must be an <a href="https://www.iso.org/obp/ui/#search/code/" target="_blank">ISO 3166-1 alpha-2 code</a>. If the parameter is invalid or missing, the __Country or territory__ field on the payment page will default to 'United Kingdom'. | ||
The `country` parameter must be an <a href="https://www.iso.org/obp/ui/#search/code/" target="_blank">ISO 3166-1 alpha-2 code</a>. If you do not include `country` or send an invalid value, the __Country or territory__ field on the payment page will default to 'United Kingdom'. | ||
|
||
## Data collected by your GOV.UK Pay admin account | ||
|
||
After your user completes their payment, your GOV.UK Pay account will collect your user's: | ||
|
||
- email address - even if you've turned off user email address collection | ||
- cardholder name | ||
- billing address - you can only see this by [using the API to get information about a payment](/reporting/#get-information-about-a-single-payment) | ||
- billing address - you can only see this by [using the API to get information about a payment](/api_reference/single_payment_reference) | ||
|
||
If your user does not complete their payment, your GOV.UK Pay account will still collect the `billing_address` value. This will happen even if you've chosen not to collect your users' billing addresses. |
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