Skip to content

Commit 488d5c9

Browse files
Merge branch 'main' into 2.4.8-develop
2 parents 1a72d76 + 1d2661d commit 488d5c9

File tree

24 files changed

+633
-184
lines changed

24 files changed

+633
-184
lines changed

.github/workflows/github-pages.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,20 @@
1-
---
2-
name: Github Pages
1+
name: Deploy Gatsby site to Pages
2+
33
on: workflow_dispatch
4-
permissions: {}
5-
jobs:
6-
build-and-deploy:
7-
runs-on: ubuntu-latest
8-
permissions:
9-
actions: read
10-
contents: write
11-
steps:
12-
- uses: actions/checkout@v4
13-
- name: Use Setup Node and Install Dependencies Action
14-
uses: commerce-docs/devsite-install-action@main
15-
with:
16-
node-version-file: '.nvmrc'
17-
cache-dependency-path: 'yarn.lock'
184

19-
- name: Build site
20-
run: yarn build
21-
env:
22-
NODE_OPTIONS: "--max-old-space-size=8192"
23-
PREFIX_PATHS: true # works like --prefix-paths flag for 'gatsby build'
24-
PATH_PREFIX: ${{ github.event.repository.name }}
25-
ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_SRC }}
26-
ADOBE_LAUNCH_SRC_INCLUDE_IN_DEVELOPMENT: ${{ secrets.ADOBE_LAUNCH_SRC_INCLUDE_IN_DEVELOPMENT }}
27-
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
REPO_OWNER: ${{ github.event.repository.owner.login }}
29-
REPO_NAME: ${{ github.event.repository.name }}
30-
REPO_BRANCH: ${{ github.ref_name }}
31-
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
32-
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
33-
GOOGLE_DOCS_TOKEN: ${{ secrets.GOOGLE_DOCS_TOKEN }}
34-
GOOGLE_DOCS_FOLDER_ID: ${{ secrets.GOOGLE_DOCS_FOLDER_ID }}
35-
- name: Deploy to GH Pages
36-
uses: JamesIves/github-pages-deploy-action@v4
37-
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
branch: gh-pages # The branch the action should deploy to.
40-
folder: public # The folder the action should deploy.
41-
clean: true # Automatically remove deleted files from deploy branch
42-
- name: GH Pages URL
43-
id: gh-pages-url
44-
run: |
45-
echo "View GH-Pages: $(https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }})"
5+
permissions:
6+
contents: read
7+
pages: write
8+
id-token: write
9+
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: false
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
call-workflow-deploy-to-pages:
20+
uses: AdobeDocs/commerce-php/.github/workflows/deploy-to-pages_job.yml@main

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
cache-dependency-path: 'yarn.lock'
6464

6565
- name: Gatsby Cache
66-
uses: actions/cache@v3.3.2
66+
uses: actions/cache@v4
6767
with:
6868
path: |
6969
public

.github/workflows/stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
cache-dependency-path: 'yarn.lock'
7575

7676
- name: Gatsby Cache
77-
uses: actions/cache@v3.3.2
77+
uses: actions/cache@v4
7878
with:
7979
path: |
8080
public
Lines changed: 5 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,12 @@
11
---
2-
###########################
3-
###########################
4-
## Pull request testing ##
5-
###########################
6-
###########################
72
name: Validate pull request
83

9-
# Documentation:
10-
# - Workflow: https://help.github.com/en/articles/workflow-syntax-for-github-actions
11-
# - SuperLinter: https://github.com/github/super-linter
12-
# - Link validation: https://github.com/remarkjs/remark-validate-links
13-
14-
######################################################
15-
# Start the job on a pull request to the main branch #
16-
######################################################
174
on: pull_request
185

19-
#################################################
20-
# Disable all permissions on the workflow level #
21-
#################################################
22-
permissions: {}
6+
permissions:
7+
contents: read
8+
statuses: write
239

24-
###############
25-
# Set the Job #
26-
###############
2710
jobs:
28-
lint:
29-
# Set the agent to run on
30-
runs-on: ubuntu-latest
31-
32-
############################################
33-
# Grant status permission for MULTI_STATUS #
34-
############################################
35-
permissions:
36-
contents: read
37-
statuses: write
38-
39-
##################
40-
# Load all steps #
41-
##################
42-
steps:
43-
##########################
44-
# Checkout the code base #
45-
##########################
46-
- name: Checkout Code
47-
uses: actions/checkout@v4
48-
with:
49-
# Full git history is needed to get a proper list of changed files
50-
# within `super-linter`
51-
fetch-depth: 0
52-
- name: Load super-linter configuration
53-
run: cat .github/super-linter.env >> "$GITHUB_ENV"
54-
55-
################################
56-
# Run Linters against code base #
57-
################################
58-
- name: Lint Code Base
59-
#
60-
# Use full version number to avoid cases when a next
61-
# released version is buggy
62-
# About slim image: https://github.com/github/super-linter#slim-image
63-
uses: super-linter/super-linter/slim@v7.2.0
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
DEFAULT_BRANCH: main
67-
68-
test:
69-
runs-on: ubuntu-latest
70-
needs: lint
71-
permissions:
72-
contents: read
73-
statuses: write
74-
steps:
75-
- uses: actions/checkout@v4
76-
- name: Use Setup Node and Install Dependencies Action
77-
uses: commerce-docs/devsite-install-action@main
78-
with:
79-
node-version-file: '.nvmrc'
80-
cache-dependency-path: 'yarn.lock'
81-
82-
- name: Check links
83-
run: yarn test
84-
85-
build:
86-
runs-on: ubuntu-latest
87-
needs: test
88-
permissions:
89-
contents: read
90-
statuses: write
91-
steps:
92-
- uses: actions/checkout@v4
93-
- name: Use Setup Node and Install Dependencies Action
94-
uses: commerce-docs/devsite-install-action@main
95-
with:
96-
node-version-file: '.nvmrc'
97-
cache-dependency-path: 'yarn.lock'
98-
99-
- name: Build site
100-
run: yarn build
11+
testing:
12+
uses: AdobeDocs/commerce-php/.github/workflows/validate-pr_job.yml@main

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/AdobeDocs/commerce-webapi"
88
},
99
"dependencies": {
10-
"@adobe/gatsby-theme-aio": "4.14.18",
10+
"@adobe/gatsby-theme-aio": "4.14.19",
1111
"gatsby": "4.22.0",
1212
"react": "^17.0.2",
1313
"react-dom": "^17.0.2"

src/data/navigation/sections/graphql.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ module.exports = [
127127
title: "Queries",
128128
path: "/graphql/schema/cart/queries/",
129129
pages: [
130+
{
131+
title: "allCartRules",
132+
path: "/graphql/schema/cart/queries/all-rules/",
133+
},
130134
{
131135
title: "cart",
132136
path: "/graphql/schema/cart/queries/cart/",
@@ -443,6 +447,14 @@ module.exports = [
443447
title: "Queries",
444448
path: "/graphql/schema/customer/queries/",
445449
pages: [
450+
{
451+
title: "allCustomerGroups",
452+
path: "/graphql/schema/customer/queries/all-groups/"
453+
},
454+
{
455+
title: "allCustomerSegments",
456+
path: "/graphql/schema/customer/queries/all-segments/"
457+
},
446458
{
447459
title: "customer",
448460
path: "/graphql/schema/customer/queries/customer/",
@@ -459,6 +471,10 @@ module.exports = [
459471
title: "customerOrders",
460472
path: "/graphql/schema/customer/queries/orders/",
461473
},
474+
{
475+
title: "customerSegments",
476+
path: "/graphql/schema/customer/queries/segments/"
477+
},
462478
{
463479
title: "giftCardAccount",
464480
path: "/graphql/schema/customer/queries/giftcard-account/",
@@ -801,6 +817,10 @@ module.exports = [
801817
title: "Queries",
802818
path: "/graphql/schema/products/queries/",
803819
pages: [
820+
{
821+
title: "allCatalogRules",
822+
path: "/graphql/schema/products/queries/all-rules/",
823+
},
804824
{
805825
title: "categories",
806826
path: "/graphql/schema/products/queries/categories/",
@@ -1249,6 +1269,14 @@ module.exports = [
12491269
title: "Minicart",
12501270
path: "/graphql/payment-services-extension/workflows/minicart.md",
12511271
},
1272+
{
1273+
title: "Vault a card during a checkout authorization",
1274+
path: "/graphql/payment-services-extension/workflows/vault-with-purchase.md",
1275+
},
1276+
{
1277+
title: "Vault a credit card without a purchase",
1278+
path: "/graphql/payment-services-extension/workflows/vault-without-purchase.md",
1279+
},
12521280
{
12531281
title: "Vaulted card",
12541282
path: "/graphql/payment-services-extension/workflows/vaulted-card.md",

src/pages/_images/graphql/payment-services-vault-with-purchase.svg

Lines changed: 4 additions & 0 deletions
Loading

src/pages/_images/graphql/payment-services-vault-without-purchase.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Vault a card during a checkout authorization
3+
description: Learn how to vault a credit card during a typical checkout authorization.
4+
keywords:
5+
- GraphQL
6+
- Payments
7+
---
8+
9+
# Vault a card during a checkout authorization
10+
11+
These steps describe the flow of requests and responses required to [vault a credit card](https://experienceleague.adobe.com/en/docs/commerce-merchant-services/payment-services/payments-checkout/vaulting#vaulting-a-payment-method-during-checkout) during a typical checkout authorization with Payment Services enabled.
12+
13+
The following conditions must be true to vault a card during checkout:
14+
15+
* You must have installed [Payment Services for Adobe Commerce](https://commercemarketplace.adobe.com/magento-payment-services.html) 2.10.0 or higher.
16+
* The customer must be logged in.
17+
18+
## Workflow
19+
20+
![Payment Services sequence diagram](../../../_images/graphql/payment-services-vault-with-purchase.svg)
21+
22+
1. Run the [`getPaymentConfig`](../../payment-services-extension/queries/get-payment-config.md) query to fetch the payment configuration needed to render details of hosted fields.
23+
24+
1. Commerce returns the payment configuration information.
25+
26+
1. Run the [`setPaymentMethodOnCart`](../../schema/cart/mutations/set-payment-method.md) mutation to [set the payment method](../../tutorials/checkout/set-payment-method.md).
27+
28+
1. Adobe Commerce returns a `Cart` object.
29+
30+
1. Run the [`createPaymentOrder`](../../payment-services-extension/mutations/create-payment-order.md) mutation with `vaultIntent` set to `true` to begin the authorization process.
31+
32+
1. Commerce forwards the request to PayPal.
33+
34+
1. PayPal returns an `id` value.
35+
36+
1. Adobe Commerce generates a `order_id` and forwards the value in the `mp_order_id` field and the PayPal response in the `id` field.
37+
38+
1. Run [`setPaymentMethodOnCart`](../../schema/cart/mutations/set-payment-method.md) again with [`is_active_payment_token_enabler`](https://developer.adobe.com/commerce/webapi/graphql/payment-services-extension/workflows/checkout/#setpaymentmethodoncartinput-object) set to `true`. This indicates whether a customer-entered credit/debit card should be tokenized for later usage.
39+
40+
1. Adobe Commerce returns a token.
41+
42+
1. (Optional) If hosted fields and the Signifyd integration are enabled, run the [`getPaymentOrder`](../../payment-services-extension/queries/get-payment-order.md) query.
43+
44+
1. (Optional) Adobe Commerce returns details about the payment order.
45+
46+
1. Run the [`placeOrder`](../../schema/cart/mutations/place-order.md) mutation.
47+
48+
1. Commerce sends an authorization request to PayPal.
49+
50+
1. PayPal returns the result to Commerce.
51+
52+
1. Commerce creates an order.
53+
54+
1. Paypal returns a vault token.
55+
56+
1. Commerce stores the vault token for the vaulted card.
57+
58+
## Additional information
59+
60+
It is only possible to vault configuration details for hosted fields. See [`getPaymentConfig`](../../payment-services-extension/queries/get-payment-config.md) query for more information.
61+
62+
### `setPaymentMethodOnCart` mutation example
63+
64+
The following example shows the `setPaymentMethodOnCart` mutation with the attribute `is_active_payment_token_enabler` set to `true`.
65+
66+
**Request:**
67+
68+
```graphql
69+
mutation {
70+
setPaymentMethodOnCart ( input: {
71+
cart_id: "uocGxUi5H97XFAMhY3s66q4aFYG3Bmdr",
72+
payment_method: {
73+
code: "payment_services_paypal_hosted_fields",
74+
payment_services_paypal_hosted_fields: {
75+
payment_source: "cc",
76+
payments_order_id: "mp-order-a4babd34-13d3-4ac0-b1b0-109bb7be1574",
77+
paypal_order_id: "9R90936863877801D",
78+
is_active_payment_token_enabler: true
79+
}
80+
}
81+
}
82+
) {
83+
cart {
84+
id
85+
selected_payment_method {
86+
code
87+
}
88+
}
89+
}
90+
}
91+
```
92+
93+
**Response:**
94+
95+
```json
96+
{
97+
"data": {
98+
"setPaymentMethodOnCart": {
99+
"cart": {
100+
"id": "uocGxUi5H97XFAMhY3s66q4aFYG3Bmdr",
101+
"selected_payment_method": {
102+
"code": "payment_services_paypal_hosted_fields"
103+
}
104+
}
105+
}
106+
}
107+
}
108+
```

0 commit comments

Comments
 (0)