@amos.com/node 0.1.13 → 0.1.16

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/dist/index.d.mts CHANGED
@@ -507,6 +507,23 @@ interface paths {
507
507
  patch?: never;
508
508
  trace?: never;
509
509
  };
510
+ "/embed/payment_intents/{id}/confirm_with_payment_method": {
511
+ parameters: {
512
+ query?: never;
513
+ header?: never;
514
+ path?: never;
515
+ cookie?: never;
516
+ };
517
+ get?: never;
518
+ put?: never;
519
+ /** Confirm a payment intent with a new payment method */
520
+ post: operations["ConfirmEmbedPaymentIntentWithPaymentMethod"];
521
+ delete?: never;
522
+ options?: never;
523
+ head?: never;
524
+ patch?: never;
525
+ trace?: never;
526
+ };
510
527
  "/payment_intents": {
511
528
  parameters: {
512
529
  query?: never;
@@ -871,6 +888,23 @@ interface paths {
871
888
  patch?: never;
872
889
  trace?: never;
873
890
  };
891
+ "/embed/setup_intents/{id}/confirm_with_payment_method": {
892
+ parameters: {
893
+ query?: never;
894
+ header?: never;
895
+ path?: never;
896
+ cookie?: never;
897
+ };
898
+ get?: never;
899
+ put?: never;
900
+ /** Confirm a setup intent with a new payment method */
901
+ post: operations["ConfirmSetupIntentWithPaymentMethod"];
902
+ delete?: never;
903
+ options?: never;
904
+ head?: never;
905
+ patch?: never;
906
+ trace?: never;
907
+ };
874
908
  "/setup_intents": {
875
909
  parameters: {
876
910
  query?: never;
@@ -1238,6 +1272,9 @@ interface components {
1238
1272
  encrypted_card_number?: string;
1239
1273
  exp_month?: number;
1240
1274
  exp_year?: number;
1275
+ moto?: boolean;
1276
+ };
1277
+ GooglePayCardProfileInput: {
1241
1278
  wallet_brand?: string;
1242
1279
  wallet_last4?: string;
1243
1280
  wallet_payload?: string;
@@ -1517,6 +1554,48 @@ interface components {
1517
1554
  PaymentLinkAmountType: "fixed" | "open";
1518
1555
  /** @enum {string} */
1519
1556
  PaymentMethodType: "card" | "bank_account";
1557
+ /** @description Payment method details used when confirming an embedded intent with a new payment method. */
1558
+ EmbedConfirmPaymentMethodInput: components["schemas"]["EmbedConfirmCardPaymentMethodInput"] | components["schemas"]["EmbedConfirmBankAccountPaymentMethodInput"] | components["schemas"]["EmbedConfirmGooglePayPaymentMethodInput"] | components["schemas"]["EmbedConfirmApplePayPaymentMethodInput"];
1559
+ EmbedConfirmCardPaymentMethodInput: {
1560
+ /**
1561
+ * @description discriminator enum property added by openapi-typescript
1562
+ * @enum {string}
1563
+ */
1564
+ type: "card";
1565
+ metadata?: components["schemas"]["Metadata"];
1566
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1567
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1568
+ };
1569
+ EmbedConfirmBankAccountPaymentMethodInput: {
1570
+ /**
1571
+ * @description discriminator enum property added by openapi-typescript
1572
+ * @enum {string}
1573
+ */
1574
+ type: "bank_account";
1575
+ metadata?: components["schemas"]["Metadata"];
1576
+ bank_account_profile_attributes: components["schemas"]["BankAccountProfileInput"];
1577
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1578
+ };
1579
+ EmbedConfirmGooglePayPaymentMethodInput: {
1580
+ /**
1581
+ * @description discriminator enum property added by openapi-typescript
1582
+ * @enum {string}
1583
+ */
1584
+ type: "googlepay";
1585
+ metadata?: components["schemas"]["Metadata"];
1586
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1587
+ card_profile_attributes: components["schemas"]["GooglePayCardProfileInput"];
1588
+ };
1589
+ EmbedConfirmApplePayPaymentMethodInput: {
1590
+ /**
1591
+ * @description discriminator enum property added by openapi-typescript
1592
+ * @enum {string}
1593
+ */
1594
+ type: "applepay";
1595
+ metadata?: components["schemas"]["Metadata"];
1596
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1597
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1598
+ };
1520
1599
  AllowedPaymentMethodOptions: {
1521
1600
  moto?: boolean;
1522
1601
  } & {
@@ -1732,6 +1811,12 @@ interface components {
1732
1811
  ConfirmPaymentIntentRequest: {
1733
1812
  payment_intent: components["schemas"]["ConfirmPaymentIntentInput"];
1734
1813
  };
1814
+ ConfirmPaymentIntentWithPaymentMethodInput: {
1815
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
1816
+ };
1817
+ ConfirmPaymentIntentWithPaymentMethodRequest: {
1818
+ payment_intent: components["schemas"]["ConfirmPaymentIntentWithPaymentMethodInput"];
1819
+ };
1735
1820
  UpdatePaymentIntentInput: {
1736
1821
  /** Format: uuid */
1737
1822
  payment_method_id?: string;
@@ -2030,6 +2115,13 @@ interface components {
2030
2115
  ConfirmSetupIntentRequest: {
2031
2116
  setup_intent: components["schemas"]["ConfirmSetupIntentInput"];
2032
2117
  };
2118
+ ConfirmSetupIntentWithPaymentMethodInput: {
2119
+ moto?: boolean;
2120
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
2121
+ };
2122
+ ConfirmSetupIntentWithPaymentMethodRequest: {
2123
+ setup_intent: components["schemas"]["ConfirmSetupIntentWithPaymentMethodInput"];
2124
+ };
2033
2125
  SetupIntent: {
2034
2126
  /** Format: uuid */
2035
2127
  id?: string;
@@ -3311,6 +3403,51 @@ interface operations {
3311
3403
  };
3312
3404
  };
3313
3405
  };
3406
+ ConfirmEmbedPaymentIntentWithPaymentMethod: {
3407
+ parameters: {
3408
+ query?: never;
3409
+ header?: never;
3410
+ path: {
3411
+ /** @description The ID of the payment intent to confirm */
3412
+ id: string;
3413
+ };
3414
+ cookie?: never;
3415
+ };
3416
+ requestBody: {
3417
+ content: {
3418
+ "application/json": components["schemas"]["ConfirmPaymentIntentWithPaymentMethodRequest"];
3419
+ };
3420
+ };
3421
+ responses: {
3422
+ /** @description Successful confirmation of payment intent */
3423
+ 202: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["PaymentIntent"];
3429
+ };
3430
+ };
3431
+ /** @description Forbidden */
3432
+ 403: {
3433
+ headers: {
3434
+ [name: string]: unknown;
3435
+ };
3436
+ content: {
3437
+ "application/json": components["schemas"]["Error"];
3438
+ };
3439
+ };
3440
+ /** @description Unprocessable content */
3441
+ 422: {
3442
+ headers: {
3443
+ [name: string]: unknown;
3444
+ };
3445
+ content: {
3446
+ "application/json": components["schemas"]["Error"];
3447
+ };
3448
+ };
3449
+ };
3450
+ };
3314
3451
  ListPaymentIntents: {
3315
3452
  parameters: {
3316
3453
  query?: {
@@ -4150,6 +4287,51 @@ interface operations {
4150
4287
  };
4151
4288
  };
4152
4289
  };
4290
+ ConfirmSetupIntentWithPaymentMethod: {
4291
+ parameters: {
4292
+ query?: never;
4293
+ header?: never;
4294
+ path: {
4295
+ /** @description The ID of the setup intent to confirm */
4296
+ id: string;
4297
+ };
4298
+ cookie?: never;
4299
+ };
4300
+ requestBody: {
4301
+ content: {
4302
+ "application/json": components["schemas"]["ConfirmSetupIntentWithPaymentMethodRequest"];
4303
+ };
4304
+ };
4305
+ responses: {
4306
+ /** @description Successful confirmation of setup intent */
4307
+ 202: {
4308
+ headers: {
4309
+ [name: string]: unknown;
4310
+ };
4311
+ content: {
4312
+ "application/json": components["schemas"]["SetupIntent"];
4313
+ };
4314
+ };
4315
+ /** @description Forbidden */
4316
+ 403: {
4317
+ headers: {
4318
+ [name: string]: unknown;
4319
+ };
4320
+ content: {
4321
+ "application/json": components["schemas"]["Error"];
4322
+ };
4323
+ };
4324
+ /** @description Unprocessable content */
4325
+ 422: {
4326
+ headers: {
4327
+ [name: string]: unknown;
4328
+ };
4329
+ content: {
4330
+ "application/json": components["schemas"]["Error"];
4331
+ };
4332
+ };
4333
+ };
4334
+ };
4153
4335
  CreateSetupIntent: {
4154
4336
  parameters: {
4155
4337
  query?: never;
package/dist/index.d.ts CHANGED
@@ -507,6 +507,23 @@ interface paths {
507
507
  patch?: never;
508
508
  trace?: never;
509
509
  };
510
+ "/embed/payment_intents/{id}/confirm_with_payment_method": {
511
+ parameters: {
512
+ query?: never;
513
+ header?: never;
514
+ path?: never;
515
+ cookie?: never;
516
+ };
517
+ get?: never;
518
+ put?: never;
519
+ /** Confirm a payment intent with a new payment method */
520
+ post: operations["ConfirmEmbedPaymentIntentWithPaymentMethod"];
521
+ delete?: never;
522
+ options?: never;
523
+ head?: never;
524
+ patch?: never;
525
+ trace?: never;
526
+ };
510
527
  "/payment_intents": {
511
528
  parameters: {
512
529
  query?: never;
@@ -871,6 +888,23 @@ interface paths {
871
888
  patch?: never;
872
889
  trace?: never;
873
890
  };
891
+ "/embed/setup_intents/{id}/confirm_with_payment_method": {
892
+ parameters: {
893
+ query?: never;
894
+ header?: never;
895
+ path?: never;
896
+ cookie?: never;
897
+ };
898
+ get?: never;
899
+ put?: never;
900
+ /** Confirm a setup intent with a new payment method */
901
+ post: operations["ConfirmSetupIntentWithPaymentMethod"];
902
+ delete?: never;
903
+ options?: never;
904
+ head?: never;
905
+ patch?: never;
906
+ trace?: never;
907
+ };
874
908
  "/setup_intents": {
875
909
  parameters: {
876
910
  query?: never;
@@ -1238,6 +1272,9 @@ interface components {
1238
1272
  encrypted_card_number?: string;
1239
1273
  exp_month?: number;
1240
1274
  exp_year?: number;
1275
+ moto?: boolean;
1276
+ };
1277
+ GooglePayCardProfileInput: {
1241
1278
  wallet_brand?: string;
1242
1279
  wallet_last4?: string;
1243
1280
  wallet_payload?: string;
@@ -1517,6 +1554,48 @@ interface components {
1517
1554
  PaymentLinkAmountType: "fixed" | "open";
1518
1555
  /** @enum {string} */
1519
1556
  PaymentMethodType: "card" | "bank_account";
1557
+ /** @description Payment method details used when confirming an embedded intent with a new payment method. */
1558
+ EmbedConfirmPaymentMethodInput: components["schemas"]["EmbedConfirmCardPaymentMethodInput"] | components["schemas"]["EmbedConfirmBankAccountPaymentMethodInput"] | components["schemas"]["EmbedConfirmGooglePayPaymentMethodInput"] | components["schemas"]["EmbedConfirmApplePayPaymentMethodInput"];
1559
+ EmbedConfirmCardPaymentMethodInput: {
1560
+ /**
1561
+ * @description discriminator enum property added by openapi-typescript
1562
+ * @enum {string}
1563
+ */
1564
+ type: "card";
1565
+ metadata?: components["schemas"]["Metadata"];
1566
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1567
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1568
+ };
1569
+ EmbedConfirmBankAccountPaymentMethodInput: {
1570
+ /**
1571
+ * @description discriminator enum property added by openapi-typescript
1572
+ * @enum {string}
1573
+ */
1574
+ type: "bank_account";
1575
+ metadata?: components["schemas"]["Metadata"];
1576
+ bank_account_profile_attributes: components["schemas"]["BankAccountProfileInput"];
1577
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1578
+ };
1579
+ EmbedConfirmGooglePayPaymentMethodInput: {
1580
+ /**
1581
+ * @description discriminator enum property added by openapi-typescript
1582
+ * @enum {string}
1583
+ */
1584
+ type: "googlepay";
1585
+ metadata?: components["schemas"]["Metadata"];
1586
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1587
+ card_profile_attributes: components["schemas"]["GooglePayCardProfileInput"];
1588
+ };
1589
+ EmbedConfirmApplePayPaymentMethodInput: {
1590
+ /**
1591
+ * @description discriminator enum property added by openapi-typescript
1592
+ * @enum {string}
1593
+ */
1594
+ type: "applepay";
1595
+ metadata?: components["schemas"]["Metadata"];
1596
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1597
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1598
+ };
1520
1599
  AllowedPaymentMethodOptions: {
1521
1600
  moto?: boolean;
1522
1601
  } & {
@@ -1732,6 +1811,12 @@ interface components {
1732
1811
  ConfirmPaymentIntentRequest: {
1733
1812
  payment_intent: components["schemas"]["ConfirmPaymentIntentInput"];
1734
1813
  };
1814
+ ConfirmPaymentIntentWithPaymentMethodInput: {
1815
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
1816
+ };
1817
+ ConfirmPaymentIntentWithPaymentMethodRequest: {
1818
+ payment_intent: components["schemas"]["ConfirmPaymentIntentWithPaymentMethodInput"];
1819
+ };
1735
1820
  UpdatePaymentIntentInput: {
1736
1821
  /** Format: uuid */
1737
1822
  payment_method_id?: string;
@@ -2030,6 +2115,13 @@ interface components {
2030
2115
  ConfirmSetupIntentRequest: {
2031
2116
  setup_intent: components["schemas"]["ConfirmSetupIntentInput"];
2032
2117
  };
2118
+ ConfirmSetupIntentWithPaymentMethodInput: {
2119
+ moto?: boolean;
2120
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
2121
+ };
2122
+ ConfirmSetupIntentWithPaymentMethodRequest: {
2123
+ setup_intent: components["schemas"]["ConfirmSetupIntentWithPaymentMethodInput"];
2124
+ };
2033
2125
  SetupIntent: {
2034
2126
  /** Format: uuid */
2035
2127
  id?: string;
@@ -3311,6 +3403,51 @@ interface operations {
3311
3403
  };
3312
3404
  };
3313
3405
  };
3406
+ ConfirmEmbedPaymentIntentWithPaymentMethod: {
3407
+ parameters: {
3408
+ query?: never;
3409
+ header?: never;
3410
+ path: {
3411
+ /** @description The ID of the payment intent to confirm */
3412
+ id: string;
3413
+ };
3414
+ cookie?: never;
3415
+ };
3416
+ requestBody: {
3417
+ content: {
3418
+ "application/json": components["schemas"]["ConfirmPaymentIntentWithPaymentMethodRequest"];
3419
+ };
3420
+ };
3421
+ responses: {
3422
+ /** @description Successful confirmation of payment intent */
3423
+ 202: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["PaymentIntent"];
3429
+ };
3430
+ };
3431
+ /** @description Forbidden */
3432
+ 403: {
3433
+ headers: {
3434
+ [name: string]: unknown;
3435
+ };
3436
+ content: {
3437
+ "application/json": components["schemas"]["Error"];
3438
+ };
3439
+ };
3440
+ /** @description Unprocessable content */
3441
+ 422: {
3442
+ headers: {
3443
+ [name: string]: unknown;
3444
+ };
3445
+ content: {
3446
+ "application/json": components["schemas"]["Error"];
3447
+ };
3448
+ };
3449
+ };
3450
+ };
3314
3451
  ListPaymentIntents: {
3315
3452
  parameters: {
3316
3453
  query?: {
@@ -4150,6 +4287,51 @@ interface operations {
4150
4287
  };
4151
4288
  };
4152
4289
  };
4290
+ ConfirmSetupIntentWithPaymentMethod: {
4291
+ parameters: {
4292
+ query?: never;
4293
+ header?: never;
4294
+ path: {
4295
+ /** @description The ID of the setup intent to confirm */
4296
+ id: string;
4297
+ };
4298
+ cookie?: never;
4299
+ };
4300
+ requestBody: {
4301
+ content: {
4302
+ "application/json": components["schemas"]["ConfirmSetupIntentWithPaymentMethodRequest"];
4303
+ };
4304
+ };
4305
+ responses: {
4306
+ /** @description Successful confirmation of setup intent */
4307
+ 202: {
4308
+ headers: {
4309
+ [name: string]: unknown;
4310
+ };
4311
+ content: {
4312
+ "application/json": components["schemas"]["SetupIntent"];
4313
+ };
4314
+ };
4315
+ /** @description Forbidden */
4316
+ 403: {
4317
+ headers: {
4318
+ [name: string]: unknown;
4319
+ };
4320
+ content: {
4321
+ "application/json": components["schemas"]["Error"];
4322
+ };
4323
+ };
4324
+ /** @description Unprocessable content */
4325
+ 422: {
4326
+ headers: {
4327
+ [name: string]: unknown;
4328
+ };
4329
+ content: {
4330
+ "application/json": components["schemas"]["Error"];
4331
+ };
4332
+ };
4333
+ };
4334
+ };
4153
4335
  CreateSetupIntent: {
4154
4336
  parameters: {
4155
4337
  query?: never;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAGO;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,aAAO,qBAAAA,SAAoB,OAAO;AACnC;","names":["createClient"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n type ClientOptions,\n type Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n return createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAGO;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AACzD,aAAO,qBAAAA,SAAoB,OAAO;AACpC;","names":["createClient"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";AAAA,OAAO,kBAGA;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,SAAO,aAAoB,OAAO;AACnC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n type ClientOptions,\n type Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n return createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";AAAA,OAAO,kBAGA;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AACzD,SAAO,aAAoB,OAAO;AACpC;","names":[]}
package/openapi/schema.ts CHANGED
@@ -504,6 +504,23 @@ export interface paths {
504
504
  patch?: never;
505
505
  trace?: never;
506
506
  };
507
+ "/embed/payment_intents/{id}/confirm_with_payment_method": {
508
+ parameters: {
509
+ query?: never;
510
+ header?: never;
511
+ path?: never;
512
+ cookie?: never;
513
+ };
514
+ get?: never;
515
+ put?: never;
516
+ /** Confirm a payment intent with a new payment method */
517
+ post: operations["ConfirmEmbedPaymentIntentWithPaymentMethod"];
518
+ delete?: never;
519
+ options?: never;
520
+ head?: never;
521
+ patch?: never;
522
+ trace?: never;
523
+ };
507
524
  "/payment_intents": {
508
525
  parameters: {
509
526
  query?: never;
@@ -868,6 +885,23 @@ export interface paths {
868
885
  patch?: never;
869
886
  trace?: never;
870
887
  };
888
+ "/embed/setup_intents/{id}/confirm_with_payment_method": {
889
+ parameters: {
890
+ query?: never;
891
+ header?: never;
892
+ path?: never;
893
+ cookie?: never;
894
+ };
895
+ get?: never;
896
+ put?: never;
897
+ /** Confirm a setup intent with a new payment method */
898
+ post: operations["ConfirmSetupIntentWithPaymentMethod"];
899
+ delete?: never;
900
+ options?: never;
901
+ head?: never;
902
+ patch?: never;
903
+ trace?: never;
904
+ };
871
905
  "/setup_intents": {
872
906
  parameters: {
873
907
  query?: never;
@@ -1235,6 +1269,9 @@ export interface components {
1235
1269
  encrypted_card_number?: string;
1236
1270
  exp_month?: number;
1237
1271
  exp_year?: number;
1272
+ moto?: boolean;
1273
+ };
1274
+ GooglePayCardProfileInput: {
1238
1275
  wallet_brand?: string;
1239
1276
  wallet_last4?: string;
1240
1277
  wallet_payload?: string;
@@ -1514,6 +1551,48 @@ export interface components {
1514
1551
  PaymentLinkAmountType: "fixed" | "open";
1515
1552
  /** @enum {string} */
1516
1553
  PaymentMethodType: "card" | "bank_account";
1554
+ /** @description Payment method details used when confirming an embedded intent with a new payment method. */
1555
+ EmbedConfirmPaymentMethodInput: components["schemas"]["EmbedConfirmCardPaymentMethodInput"] | components["schemas"]["EmbedConfirmBankAccountPaymentMethodInput"] | components["schemas"]["EmbedConfirmGooglePayPaymentMethodInput"] | components["schemas"]["EmbedConfirmApplePayPaymentMethodInput"];
1556
+ EmbedConfirmCardPaymentMethodInput: {
1557
+ /**
1558
+ * @description discriminator enum property added by openapi-typescript
1559
+ * @enum {string}
1560
+ */
1561
+ type: "card";
1562
+ metadata?: components["schemas"]["Metadata"];
1563
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1564
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1565
+ };
1566
+ EmbedConfirmBankAccountPaymentMethodInput: {
1567
+ /**
1568
+ * @description discriminator enum property added by openapi-typescript
1569
+ * @enum {string}
1570
+ */
1571
+ type: "bank_account";
1572
+ metadata?: components["schemas"]["Metadata"];
1573
+ bank_account_profile_attributes: components["schemas"]["BankAccountProfileInput"];
1574
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1575
+ };
1576
+ EmbedConfirmGooglePayPaymentMethodInput: {
1577
+ /**
1578
+ * @description discriminator enum property added by openapi-typescript
1579
+ * @enum {string}
1580
+ */
1581
+ type: "googlepay";
1582
+ metadata?: components["schemas"]["Metadata"];
1583
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1584
+ card_profile_attributes: components["schemas"]["GooglePayCardProfileInput"];
1585
+ };
1586
+ EmbedConfirmApplePayPaymentMethodInput: {
1587
+ /**
1588
+ * @description discriminator enum property added by openapi-typescript
1589
+ * @enum {string}
1590
+ */
1591
+ type: "applepay";
1592
+ metadata?: components["schemas"]["Metadata"];
1593
+ billing_address_attributes?: components["schemas"]["BillingAddressInput"];
1594
+ card_profile_attributes: components["schemas"]["CardProfileInput"];
1595
+ };
1517
1596
  AllowedPaymentMethodOptions: {
1518
1597
  moto?: boolean;
1519
1598
  } & {
@@ -1729,6 +1808,12 @@ export interface components {
1729
1808
  ConfirmPaymentIntentRequest: {
1730
1809
  payment_intent: components["schemas"]["ConfirmPaymentIntentInput"];
1731
1810
  };
1811
+ ConfirmPaymentIntentWithPaymentMethodInput: {
1812
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
1813
+ };
1814
+ ConfirmPaymentIntentWithPaymentMethodRequest: {
1815
+ payment_intent: components["schemas"]["ConfirmPaymentIntentWithPaymentMethodInput"];
1816
+ };
1732
1817
  UpdatePaymentIntentInput: {
1733
1818
  /** Format: uuid */
1734
1819
  payment_method_id?: string;
@@ -2027,6 +2112,13 @@ export interface components {
2027
2112
  ConfirmSetupIntentRequest: {
2028
2113
  setup_intent: components["schemas"]["ConfirmSetupIntentInput"];
2029
2114
  };
2115
+ ConfirmSetupIntentWithPaymentMethodInput: {
2116
+ moto?: boolean;
2117
+ payment_method: components["schemas"]["EmbedConfirmPaymentMethodInput"];
2118
+ };
2119
+ ConfirmSetupIntentWithPaymentMethodRequest: {
2120
+ setup_intent: components["schemas"]["ConfirmSetupIntentWithPaymentMethodInput"];
2121
+ };
2030
2122
  SetupIntent: {
2031
2123
  /** Format: uuid */
2032
2124
  id?: string;
@@ -3308,6 +3400,51 @@ export interface operations {
3308
3400
  };
3309
3401
  };
3310
3402
  };
3403
+ ConfirmEmbedPaymentIntentWithPaymentMethod: {
3404
+ parameters: {
3405
+ query?: never;
3406
+ header?: never;
3407
+ path: {
3408
+ /** @description The ID of the payment intent to confirm */
3409
+ id: string;
3410
+ };
3411
+ cookie?: never;
3412
+ };
3413
+ requestBody: {
3414
+ content: {
3415
+ "application/json": components["schemas"]["ConfirmPaymentIntentWithPaymentMethodRequest"];
3416
+ };
3417
+ };
3418
+ responses: {
3419
+ /** @description Successful confirmation of payment intent */
3420
+ 202: {
3421
+ headers: {
3422
+ [name: string]: unknown;
3423
+ };
3424
+ content: {
3425
+ "application/json": components["schemas"]["PaymentIntent"];
3426
+ };
3427
+ };
3428
+ /** @description Forbidden */
3429
+ 403: {
3430
+ headers: {
3431
+ [name: string]: unknown;
3432
+ };
3433
+ content: {
3434
+ "application/json": components["schemas"]["Error"];
3435
+ };
3436
+ };
3437
+ /** @description Unprocessable content */
3438
+ 422: {
3439
+ headers: {
3440
+ [name: string]: unknown;
3441
+ };
3442
+ content: {
3443
+ "application/json": components["schemas"]["Error"];
3444
+ };
3445
+ };
3446
+ };
3447
+ };
3311
3448
  ListPaymentIntents: {
3312
3449
  parameters: {
3313
3450
  query?: {
@@ -4147,6 +4284,51 @@ export interface operations {
4147
4284
  };
4148
4285
  };
4149
4286
  };
4287
+ ConfirmSetupIntentWithPaymentMethod: {
4288
+ parameters: {
4289
+ query?: never;
4290
+ header?: never;
4291
+ path: {
4292
+ /** @description The ID of the setup intent to confirm */
4293
+ id: string;
4294
+ };
4295
+ cookie?: never;
4296
+ };
4297
+ requestBody: {
4298
+ content: {
4299
+ "application/json": components["schemas"]["ConfirmSetupIntentWithPaymentMethodRequest"];
4300
+ };
4301
+ };
4302
+ responses: {
4303
+ /** @description Successful confirmation of setup intent */
4304
+ 202: {
4305
+ headers: {
4306
+ [name: string]: unknown;
4307
+ };
4308
+ content: {
4309
+ "application/json": components["schemas"]["SetupIntent"];
4310
+ };
4311
+ };
4312
+ /** @description Forbidden */
4313
+ 403: {
4314
+ headers: {
4315
+ [name: string]: unknown;
4316
+ };
4317
+ content: {
4318
+ "application/json": components["schemas"]["Error"];
4319
+ };
4320
+ };
4321
+ /** @description Unprocessable content */
4322
+ 422: {
4323
+ headers: {
4324
+ [name: string]: unknown;
4325
+ };
4326
+ content: {
4327
+ "application/json": components["schemas"]["Error"];
4328
+ };
4329
+ };
4330
+ };
4331
+ };
4150
4332
  CreateSetupIntent: {
4151
4333
  parameters: {
4152
4334
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amos.com/node",
3
- "version": "0.1.13",
3
+ "version": "0.1.16",
4
4
  "description": "Node.js client for the Amos Pay API.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import createClient, {
2
- type ClientOptions,
3
- type Middleware,
2
+ type ClientOptions,
3
+ type Middleware,
4
4
  } from "openapi-fetch";
5
5
  import type { paths } from "../openapi/schema";
6
6
 
@@ -45,7 +45,7 @@ export const PAY_API_VERSION = "1";
45
45
  * ```
46
46
  */
47
47
  export function createPayApiClient(options: ClientOptions) {
48
- return createClient<paths>(options);
48
+ return createClient<paths>(options);
49
49
  }
50
50
 
51
51
  /** A configured Amos Pay API client returned by {@link createPayApiClient}. */