Skip to content

Payment Source programs: add, remove

The Payment Source Verbs add, remove as MCP do programs, with inputs, result, refusals and an example.

Reference for Payment Source, one group of Payment Source programs.

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.

Text
do: return await $.PaymentSource.add(input)

Emits PaymentSource.added.

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe Customer who saves it.
kindstringrequiredHow it pays; the form offers only the kinds the Customer’s Market accepts.
defaultbooleanTrue to charge it for every new Invoice and renewal.

Returns

OutputTypeRequiredDescription
paymentSourcePayment SourcerequiredThe saved Payment Source; Stripe holds its details.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.PaymentSource.add({ customer: 'cus_K1BROJhqzZ', kind: 'card' })"
  }
}

PaymentSource.remove

Remove detaches a saved Payment Source so nothing charges it again, and keeps the record. Verb page.

Text
do: return await $.PaymentSource.remove(input)

Emits PaymentSource.removed.

Inputs

InputTypeRequiredDescription
paymentSourcePayment SourcerequiredThe saved Payment Source.

Returns

OutputTypeRequiredDescription
paymentSourcePayment SourcerequiredThe removed Payment Source, kept on record.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.PaymentSource.remove({ paymentSource: 'pm_puFT0MuuUM' })"
  }
}