Payment Source commands: add, remove
The Payment Source Verbs add, remove as CLI commands, with inputs, result, refusals and an example.
Reference for Payment Source, one group of Payment Source commands.
PaymentSource.add
Add saves a new Payment Source for a Customer through Stripe’s embedded form on the Startup’s Domain, and can make it the default. Verb page.
npx startup-builder do PaymentSource.add --json '<input>' [--try | --send | --do]Emits PaymentSource.added.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
customer | Customer | required | The Customer who saves it. |
kind | string | required | How it pays; the form offers only the kinds the Customer’s Market accepts. |
default | boolean | True to charge it for every new Invoice and renewal. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
paymentSource | Payment Source | required | The saved Payment Source; Stripe holds its details. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
npx startup-builder do PaymentSource.add --json '{"customer": "cus_K1BROJhqzZ", "kind": "card"}'PaymentSource.remove
Remove detaches a saved Payment Source so nothing charges it again, and keeps the record. Verb page.
npx startup-builder do PaymentSource.remove --json '<input>' [--try | --send | --do]Emits PaymentSource.removed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
paymentSource | Payment Source | required | The saved Payment Source. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
paymentSource | Payment Source | required | The removed Payment Source, kept on record. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
npx startup-builder do PaymentSource.remove --json '{"paymentSource": "pm_puFT0MuuUM"}'