Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Visa Account Funding Transactions #9

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 51 additions & 2 deletions payments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ If you are building a web payment form, check out these
- [Examples](#examples-1)

Create a new customer initiated payment order. A successful payment order
returns an authorization to later capture the funds. A payment order by itself
does not move funds.
returns an authorization to later capture the funds.

A payment order may be for a future payment such as in a "save card" scenario or
a subscription. See the [payments plans](#payment-plans) section for further
Expand Down Expand Up @@ -66,6 +65,24 @@ POST https://b.paylike.io/payments
returnUrl: URL, // optional, return to this URL for redirect-based flows
},

// optional
source: {
holder: 'destination', // optional
}
// optional
destination: {
addic marked this conversation as resolved.
Show resolved Hide resolved
id: String, // optional, length: 1..1024
// optional
holder: {
id: String, // optional, length: 1..1024
name: String, // optional, length: 1..1024
address: String, // optional, length: 1..1024
city: String, // optional, length: 1..1024
state: String, // optional, length: 1..1024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe at least the state (as is the country) should be expected as {2,2}?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable..

Copy link
Member Author

@tjconcept tjconcept Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I changed it to be an actual ISO code instead:

The second part is a string of up to three alphanumeric characters

The stricter requirements for AFTs (two letters) is valid for US and CA.

country: String, // optional, ISO 3166-1 alpha-2 code (e.g. US)
},
},

// optional
custom,

Expand Down Expand Up @@ -217,6 +234,38 @@ The URL to which the user should be redirected after confirming or declining a
payment. For apps, this would be your app URL as registered with the OS (e.g.
`myapp://page`), otherwise it is a URL for the specific order on your website.

### `source`

Provide additional information on the account/funding source of the amount.

#### `source.holder`

Provide additional information about the holder of the account/funding source.

Currently only the string `destination` is supported indicating that the holder
is the same entity as that of the destination.

### `destination`

Provide additional information on the destination account for the amount.

#### `destination.id`

A unique identifier for the destination account for the amount. An example could
be an IBAN or an internal wallet number.

#### `destination.holder`

Provide additional information about the holder of the destination account for
the amount.

##### `destination.holder.id`

A unique identifier for the holder of the destination account for the amount.
This could be an internal customer number.

This property may be relevant for e.g. "top up/funding" payments.

### `custom`

This field is a free-form (JSON) field to attach information related to the
Expand Down
44 changes: 44 additions & 0 deletions payments/visa-afts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Visa Account Funding Transaction (AFT)

For various reasons it may be beneficial for payments to qualify for being
processed as Visa AFTs. This document lists the minimum requirements.

- The integration used must be setup for AFTs in collaboration with the support
team
- The payment method must support Visa AFTs, namely a Visa card or a supporting
wallet of such
- The payment must include the data highlighted below in the specified format

Below is an excerpt from the payments object of [Payments](./index.md), where
additional information on each field is also available.

```javascript
{
amount: Money,

// ...

source: {
holder: 'destination',
},
destination: {
id: /[\x20-\x7E]{1,34}/,
holder: {
id: /[\x20-\x7E]{1,16}/,
name: /[\x20-\x7E]{2,30}/,
address: /[\x20-\x7E]{1,35}/,
city: /[\x20-\x7E]{1,25}/,

// for country US or CA
state: /[A-Z]{2}/,

country: /[A-Z]{2}/, // ISO 3166-1 alpha-2 code (e.g. US)
},
},

// ...
}
```

The regular expression `[\x20-\x7E]` is that of
[ASCII printable characters](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).