Skip to content

Commit

Permalink
Merge pull request #2140 from SwedbankPay/release/4.8.0
Browse files Browse the repository at this point in the history
Release 4.8.0 (master)
  • Loading branch information
arebra authored Feb 26, 2024
2 parents 0752d82 + f1cd1cf commit 801cfc5
Show file tree
Hide file tree
Showing 30 changed files with 790 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: TimonVS/pr-labeler-action@v4.1.1
- uses: TimonVS/pr-labeler-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions _includes/checkout-v3-resource-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"tokens": [
{
"type": "payment",
Expand Down Expand Up @@ -805,6 +806,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"cardBrand": "Visa",
"cardType": "Credit",
Expand Down Expand Up @@ -843,6 +845,7 @@ api-supported-versions: 3.1/3.0/2.0
"number": 80100001190,
"payeeReference": "1662360210",
"amount": 1500,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -884,6 +887,7 @@ api-supported-versions: 3.1/3.0/2.0
"number": 80100001190,
"payeeReference": "1662360210",
"amount": 1500,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -929,6 +933,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -971,6 +976,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -1011,6 +1017,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"misidn": "+46739000001"
}
Expand Down Expand Up @@ -1043,6 +1050,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {}
}
}
Expand Down Expand Up @@ -1073,6 +1081,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {}
}
}
Expand Down Expand Up @@ -1104,6 +1113,7 @@ api-supported-versions: 3.1/3.0/2.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"trustlyOrderId": 123456789
}
Expand All @@ -1127,6 +1137,7 @@ api-supported-versions: 3.1/3.0/2.0
| {% f submittedAmount %} | `integer` | This field will display the initial payment order amount, not including any instrument specific discounts or fees. The final payment order amount will be displayed in the `amount` field. |
| {% f feeAmount %} | `integer` | If the payment instrument used had a unique fee, it will be displayed in this field. |
| {% f discountAmount %} | `integer` | If the payment instrument used had a unique discount, it will be displayed in this field. |
| {% f paymentTokenGenerated %} | `bool` | Set to `true` or `false`. Used to show if a payment token has been generated or not. Will be set to `true` if the checkbox enabled by `EnablePaymentDetailsConsentCheckbox` has been checked by the payer during a payment, otherwise `false`. |
| {% f tokens %} | `integer` | A list of tokens connected to the payment. |
| {% f type, 2 %} | `string` | {% f payment, 0 %}, `recurrence`, `transactionOnFile` or `unscheduled`. The different types of available tokens. |
| {% f token, 2 %} | `string` | The token `guid`. |
Expand Down
11 changes: 11 additions & 0 deletions _includes/checkout-v3-status-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"vatAmount": 375,
"remainingCaptureAmount": 1500,
"remainingCancellationAmount": 1500,
Expand Down Expand Up @@ -506,6 +507,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -546,6 +548,7 @@ api-supported-versions: 3.1/3.0
"number": 80100001190,
"payeeReference": "1662360210",
"amount": 1500,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -587,6 +590,7 @@ api-supported-versions: 3.1/3.0
"number": 80100001190,
"payeeReference": "1662360210",
"amount": 1500,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -632,6 +636,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890",
Expand Down Expand Up @@ -676,6 +681,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"nonPaymentToken": "12345678-1234-1234-1234-1234567890AB",
"externalNonPaymentToken": "1234567890"
Expand Down Expand Up @@ -716,6 +722,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"misidn": "+46739000001"
}
Expand Down Expand Up @@ -748,6 +755,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {}
}
}
Expand Down Expand Up @@ -778,6 +786,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {}
}
}
Expand Down Expand Up @@ -809,6 +818,7 @@ api-supported-versions: 3.1/3.0
"submittedAmount": 1500,
"feeAmount": 0,
"discountAmount": 0,
"paymentTokenGenerated": false,
"details": {
"trustlyOrderId": 123456789
}
Expand All @@ -835,6 +845,7 @@ responses:
| {% f submittedAmount %} | `integer` | This field will display the initial payment order amount, not including any instrument specific discounts or fees. The final payment order amount will be displayed in the `amount` field. |
| {% f feeAmount %} | `integer` | If the payment instrument used had a unique fee, it will be displayed in this field. |
| {% f discountAmount %} | `integer` | If the payment instrument used had a unique discount, it will be displayed in this field. |
| {% f paymentTokenGenerated %} | `bool` | Set to `true` or `false`. Used to show if a payment token has been generated or not. Will be set to `true` if the checkbox enabled by `EnablePaymentDetailsConsentCheckbox` has been checked by the payer during a payment, otherwise `false`. |
| {% f details %} | `integer` | Details connected to the payment. |
| {% f nonPaymentToken, 2 %} | `string` | The result of our own card tokenization. Activated in POS for the merchant or merchant group. |
| {% f externalNonPaymentToken, 2 %} | `string` | The result of an external tokenization. This value will vary depending on card types, acquirers, customers, etc. For Mass Transit merchants, transactions will be populated with the `paymentAccountReference`. |
Expand Down
30 changes: 30 additions & 0 deletions _includes/fields/payment-url-paymentorder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{%- capture url -%}
{%- include utils/documentation-section-url.md
href='/features/technical-reference/payment-url' -%}
{%- endcapture -%}
{%- assign resource=include.resource | default: 'payment order' -%}
{%- capture text -%}
The {% clink `paymentUrl` %}{{ url }}{% endclink %} represents the URL that
Swedbank Pay will redirect back to when the view-operation needs to be loaded,
to inspect and act on the current status of the payment, such as when the payer
is redirected out of the Seamless View (the `<iframe>`) and sent back after
completing the payment. `paymentUrl` is only used in Seamless Views and should
point to the page of where the Payment Order Seamless View is hosted. If both
`cancelUrl` and `paymentUrl` is sent, the `paymentUrl` will used. Trustly will
only be available if the `paymentUrl` is provided while using Seamless View.
With Redirect Trustly will appear regardless.
{%- endcapture -%}
{%- comment -%}
The following chain of Liquid filters converts newlines to spaces and removes
extranous spaces.
{%- endcomment -%}
{{- text | newline_to_br | strip_newlines | split: '<br />' | join: ' ' | strip -}}
{%- comment -%} The dashes in the Liquid code tags remove output space.
More on that here:

<https://shopify.github.io/liquid/basics/whitespace/>

It's essential to have control over newlines in this file. If unintentional
newlines sneak into what's rendered by this include, it will break all tables
it is included in, so please beware.
{%- endcomment -%}
14 changes: 13 additions & 1 deletion _includes/frictionless-payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ the better.
"payer": {
"email": "[email protected]",
"msisdn": "+4798765432",
"firstName": "Olivia",
"lastName": "Nyhuus",
"workPhoneNumber" : "+4787654321",
"homePhoneNumber" : "+4776543210",
"shippingAddress": {
Expand Down Expand Up @@ -152,7 +154,9 @@ the better.
| :---- | :--- | :---------- |
| {% f payer %} | `object` | The payer object. |
| {% f email %} | `string` | Payer's registered email address. |
| {% f msisdn %} | `string` | Payer's registered mobile phone number. |
| {% f msisdn %} | `string` | Payer's registered mobile phone number. |
| {% f firstname %} | `string` | Payers's first name. Please note that this is not the `addressee` or from `shippingAddress`, as they might not be the same as the payer. |
| {% f lastname %} | `string` | Payers's last name. Please note that this is not the `addressee` or `lastName` from `shippingAddress`, as they might not be the same as the payer. | |
| {% f homePhoneNumber %} | `string` | Payer's registered home phone number. |
| {% f workPhoneNumber %} | `string` | Payer's registered work phone number. |
| {% f shippingAddress %} | `object` | The shipping address object related to the `payer`. |
Expand All @@ -162,6 +166,14 @@ the better.
| {% f zipCode, 2 %} | `string` | Payer's zip code. |
| {% f city, 2 %} | `string` | Payer's city of residence. |
| {% f countryCode, 2 %} | `string` | Country Code for the country of residence. |
| {% f billingAddress %} | `object` | The billing address object containing information about the payer's billing address. |
| {% f firstName %} | `string` | The payer's first name. |
| {% f lastName %} | `string` | The payer's last name. |
| ︎ {% f streetAddress %} | `string` | The payer'a street address. Maximum 50 characters long. |
| {% f coAddress %} | `string` | The payer's CO-address (if used). |
| {% f zipCode %} | `string` | The postal number (ZIP code) of the payer. |
| {% f city %} | `string` | The city of the payer. |
| {% f countryCode %} | `string` | `SE`, `NO`, or `FI`. |

{% endif %}

Expand Down
59 changes: 47 additions & 12 deletions _includes/network-tokenization.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,61 @@ The `GET` request to retrieve these should look similar to this.

```http
GET /psp/paymentorders/payerownedtokens/<payerReference> HTTP/1.1
Host: {{ page.api_host }}
Authorization: Bearer <AccessToken>
Content-Type: application/json;version=3.1/3.0/2.0 // Version optional for 3.0 and 2.0
```

Among the response fields for the relevant token, you should be able to find
these Network Tokenization related fields.

{:.code-view-header}
**GET Tokens Response**

```http
HTTP/1.1 200 OK
Content-Type: application/json
"instrumentParameters": {
"expiryDate": "12/2025",
"cardBrand": "Visa",
"lastFourPan": "6981",
"lastFourDPan": "8188",
"issuerName": "BankName"
}
Content-Type: application/json; charset=utf-8; version=3.1/3.0/2.0
api-supported-versions: 3.1/3.0/2.0
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8; version=3.1/3.0/2.0
api-supported-versions: 3.1/3.0/2.0
{
"payerOwnedTokens": {
"id": "/psp/paymentorders/payerownedtokens/{payerReference}",
"payerReference": "{payerReference}",
"tokens": [
{
"token": "{token}",
"tokenType": "Unscheduled",
"instrument": "CreditCard",
"instrumentDisplayName": "492500******0004",
"correlationId": "e2f06785-805d-4605-bf40-426a725d313d",
"instrumentParameters": {
"expiryDate": "12/2025",
"cardBrand": "Visa",
"lastFourPan": "0004",
"lastFourDPan": "8188",
"issuerName": "BankName"
},
"operations": [
{
"method": "PATCH",
"href": "https://api.internaltest.payex.com/psp/paymentorders/unscheduledtokens/e2f06785-805d-4605-bf40-426a725d313d",
"rel": "delete-unscheduledtokens",
"contentType": "application/json"
}
]
}
]
},
"operations": [
{
"method": "PATCH",
"href": "https://api.internaltest.payex.com/psp/paymentorders/payerOwnedPaymentTokens/{payerReference}",
"rel": "delete-payerownedtokens",
"contentType": "application/json"
}
]
}
```

{:.table .table-striped .mb-5}
Expand Down
39 changes: 38 additions & 1 deletion _includes/one-click-payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ purchases.

{% endif %}

### API Requests To Generate The Payment Token
## API Requests To Generate The Payment Token

When making the initial purchase request, you need to generate a `paymentToken`.
You can do this by setting the `generatePaymentToken` field in the request's
Expand Down Expand Up @@ -70,6 +70,43 @@ setting the initial operation to [`Verify`][verify].
{% endcapture %}
{% include accordion-table.html content=table %}

{% if documentation_section contains "checkout-v3" %}

## Enable Payment Details Consent Checkbox

Use the same basic initial payment order request, and add the new field
`enablePaymentDetailsConsentCheckbox` in the `paymentOrder` node. Set it to
`true` to show the checkbox used to store payment details for card payments.
Remember to also set `disableStoredPaymentDetails` to `true`.

This option will not work with `Verify`, and will result in a validation error
if you try.

{:.code-view-header}
**Payment Details Consent Checkbox**

```json
{
"paymentorder": {
"enablePaymentDetailsConsentCheckbox": true,
"disableStoredPaymentDetails": true,
}
}
```

{% capture table %}
{:.table .table-striped .mb-5}
| Required | Field | Type | Description |
| :--------------: | :--------------------------------- | :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {% icon check %} | {% f paymentOrder, 0 %} | `object` | The payment order object. |
| | {% f EnablePaymentDetailsConsentCheckbox %} | `bool` | Set to `true` or `false`. Used to determine if the checkbox used to save payment details is shown or not. Will only work if the parameter `disableStoredPaymentDetails` is set to `true`. |
| | {% f disableStoredPaymentDetails %} | `bool` | Set to `true` or `false`. Must be set to `true` for `enablePaymentDetailsConsentCheckbox` to work. |

{% endcapture %}
{% include accordion-table.html content=table %}

{% endif %}

## Finding The `paymentToken` Value

{% if documentation_section contains "payment-instruments" %}
Expand Down
Loading

0 comments on commit 801cfc5

Please sign in to comment.