@12-apps/payments-e2e 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,7 +84,8 @@ files do not change either way.
84
84
  `pix-only` · `card` · `both-methods` · `hosted` · `awaiting` · `settles` ·
85
85
  `declined` · `unresolved` · `unavailable` · `no-provider` ·
86
86
  `no-provider-remedy` · `payments-off` · `two-mintable` · `redirect-head` ·
87
- `screen-on-page` · `screen-handoff` · `screen-undeclared` · `screen-unknown`
87
+ `google-pay` · `screen-on-page` · `screen-handoff` · `screen-undeclared` ·
88
+ `screen-unknown`
88
89
 
89
90
  Adding a member is a breaking change for hosts, deliberately: a scenario needing
90
91
  a store nobody can build is a scenario that silently never runs.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=carteira.steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carteira.steps.d.ts","sourceRoot":"","sources":["../../src/steps/carteira.steps.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import { expect } from '@playwright/test';
2
+ import { paymentsWorld } from '../world.js';
3
+ import { Given, Then, When } from './fixtures.js';
4
+ /**
5
+ * PAYING WITH A DIGITAL WALLET (FUT-471) — the CARD pane's fast lane.
6
+ *
7
+ * The wallet is not a fourth method: the buyer still walks Dados and still
8
+ * lands on the CARD pane; what changes is that the instrument comes from the
9
+ * wallet sheet instead of typed digits. So these steps sit beside the buyer's
10
+ * card gestures, and the Givens name store shapes exactly like `loja.steps.ts`.
11
+ *
12
+ * The button element itself is rendered by the wallet's own script (brand
13
+ * rules), inside the package's `google-pay-button` container — a host
14
+ * satisfies the store shape by installing a `google.payments.api` stub before
15
+ * the checkout loads, which the shipped button picks up without a network
16
+ * request.
17
+ */
18
+ Given('a compradora abre o checkout de uma loja com Google Pay', async ({ page }) => {
19
+ await paymentsWorld().open(page, 'google-pay');
20
+ });
21
+ When('ela paga com o Google Pay', async ({ page }) => {
22
+ await page.getByTestId('google-pay-button').click();
23
+ });
24
+ Then('ela vê o botão do Google Pay', async ({ page }) => {
25
+ await expect(page.getByTestId('google-pay-button')).toBeVisible();
26
+ });
27
+ Then('nenhum botão do Google Pay é mostrado', async ({ page }) => {
28
+ await expect(page.getByTestId('google-pay-button')).toHaveCount(0);
29
+ });
30
+ Then('a cobrança enviada ao provedor carrega a carteira do Google', async ({ page }) => {
31
+ // What the PROVIDER received, not what the client recorded sending: hosts
32
+ // tag a provider-charge line with `wallet:<TYPE>` when the charge's card
33
+ // block carried a wallet instrument, the same way the card line carries
34
+ // `tok:`. This is the line that fails if the mount stops reading the flat
35
+ // wallet body — the sheet then produced a token the charge never carried.
36
+ await expect(paymentsWorld().wire.providerCharges(page)).toContainText('wallet:GOOGLE_PAY');
37
+ });
38
+ //# sourceMappingURL=carteira.steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carteira.steps.js","sourceRoot":"","sources":["../../src/steps/carteira.steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;GAaG;AAEH,KAAK,CAAC,yDAAyD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAClF,MAAM,aAAa,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2BAA2B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACnD,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8BAA8B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACtD,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACpE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uCAAuC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC/D,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6DAA6D,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACrF,0EAA0E;IAC1E,yEAAyE;IACzE,wEAAwE;IACxE,0EAA0E;IAC1E,0EAA0E;IAC1E,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAC9F,CAAC,CAAC,CAAC"}
package/dist/world.d.ts CHANGED
@@ -55,6 +55,14 @@ export type PaymentsStore =
55
55
  | 'two-mintable'
56
56
  /** A hand-off provider at the head, a minting one behind it. */
57
57
  | 'redirect-head'
58
+ /**
59
+ * A store whose chain head declares Google Pay (FUT-471): the wallet
60
+ * capability, the PAYMENT_GATEWAY parameters, a merchant id — and a page
61
+ * where `google.payments.api` answers, which the host provides by
62
+ * installing a stub of it before the checkout loads (the shipped button
63
+ * uses an installed global without touching the network).
64
+ */
65
+ | 'google-pay'
58
66
  /** Declares the on-page screen (FUT-596). */
59
67
  | 'screen-on-page'
60
68
  /** Declares the hand-off screen (FUT-596). */
@@ -1 +1 @@
1
- {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;GAYG;AACH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C;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,0EAA0E;YACxE,0EAA0E,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"world.js","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAyIA,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAoB;IACtD,SAAS,GAAG,KAAK,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,0EAA0E;YACxE,0EAA0E,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,23 @@
1
+ @journey @google-pay
2
+ Feature: Comprando com Google Pay
3
+
4
+ A carteira não é um quarto meio de pagamento: é outro jeito de produzir o
5
+ cartão. O botão só existe quando a loja declarou a carteira E o aparelho
6
+ disse que consegue pagar — um botão que leva a compradora até a folha do
7
+ Google para depois recusar a cobrança é pior do que nenhum botão. O
8
+ formulário de cartão continua na tela como alternativa o tempo todo.
9
+
10
+ Scenario: A compra inteira acontece pela carteira
11
+ Given a compradora abre o checkout de uma loja com Google Pay
12
+ When ela informa o CPF e segue para o pagamento
13
+ Then ela vê o botão do Google Pay
14
+ And ela vê o formulário de cartão
15
+ When ela paga com o Google Pay
16
+ Then o pagamento é confirmado
17
+ And a cobrança enviada ao provedor carrega a carteira do Google
18
+
19
+ Scenario: Uma loja sem carteira nunca mostra o botão
20
+ Given a compradora abre o checkout da loja de cartão
21
+ When ela informa o CPF e segue para o pagamento
22
+ Then nenhum botão do Google Pay é mostrado
23
+ And ela vê o formulário de cartão
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/payments-e2e",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "The payments buyer journeys, as Gherkin a host runs against its own app",
6
6
  "repository": {
@@ -32,8 +32,8 @@
32
32
  "playwright-bdd": ">=8.0.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@12-apps/eslint-config": "^1.18.0",
36
- "@12-apps/typescript-config": "^1.18.0",
35
+ "@12-apps/eslint-config": "^1.19.0",
36
+ "@12-apps/typescript-config": "^1.19.0",
37
37
  "@playwright/test": "^1.56.1",
38
38
  "playwright-bdd": "^8.4.1",
39
39
  "typescript": "5.9.2"