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

feat/card-exp-documentation #361

Merged
merged 6 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat/card-exp-documentation
  • Loading branch information
JustJordanT committed Apr 10, 2024
commit b396d5e92eb362c12420c933214db4d270a19261
6 changes: 6 additions & 0 deletions docs/expressions/filters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ Returns the card's expiration date in a given format. The format can be specifie
- `MMYY`: 2-digit month, year
- `YYYY`: 4-digit year
- `YYYY-MM`: 4-digit year ,2-digit month
JustJordanT marked this conversation as resolved.
Show resolved Hide resolved
- `MM/YY`: 2-digit month, 2-digit year
- `MM/YYYY`: 2-digit month, 4-digit year
- `MM_YYYY`: 2-digit month, 4-digit year
- `MM-YYYY`: 2-digit month, 4-digit year

#### Parameters

Expand Down Expand Up @@ -237,8 +241,10 @@ Given a token with the data:
| ------------------------------------------------------ | ----------- |
| <code>\{\{ data &#124; card_exp: 'MM' }}</code> | `"10"` |
| <code>\{\{ data &#124; card_exp: 'MMYY' }}</code> | `"1028"` |
| <code>\{\{ data &#124; card_exp: 'MM/YY' }}</code> | `"10/28"` |
| <code>\{\{ data &#124; card_exp: 'YYYY' }}</code> | `"2028"` |
| <code>\{\{ data &#124; card_exp: 'YYYY-MM' }}</code> | `"2028-10"` |
| <code>\{\{ data &#124; card_exp: 'YYYY/MM' }}</code> | `"2028/10"` |



Expand Down
30 changes: 15 additions & 15 deletions docs/guides/share/process-card-payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ curl 'https://api.basistheory.com/proxy' \
--data-urlencode 'type=card' \
// highlight-start
--data-urlencode 'card[number]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.number" }}' \
--data-urlencode 'card[exp_month]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_month" }}' \
--data-urlencode 'card[exp_year]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_year" }}' \
--data-urlencode 'card[exp_month]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm' }}' \
JustJordanT marked this conversation as resolved.
Show resolved Hide resolved
--data-urlencode 'card[exp_year]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp:: 'yyyy' }}' \
--data-urlencode 'card[cvc]={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.cvc" }}'
// highlight-end
```
Expand Down Expand Up @@ -123,8 +123,8 @@ curl 'https://api.basistheory.com/proxy' \
"type": "scheme",
// highlight-start
"number": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"expiryMonth": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" | pad_left: 2, \"0\" }}",
"expiryYear": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" }}",
"expiryMonth": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm' }}",
"expiryYear": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy' }}",
"cvc": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.cvc\" }}",
// highlight-end
"holderName": "John Smith"
Expand Down Expand Up @@ -169,7 +169,7 @@ curl 'https://api.basistheory.com/proxy' \
"card": {
// highlight-start
"ccAccountNum": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"ccExp": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" | pad_left: 2, \"0\" }}"
"ccExp": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyymm' }}"
// highlight-end
}
},
Expand Down Expand Up @@ -202,7 +202,7 @@ curl 'https://api.basistheory.com/proxy' \
-H 'Content-Type: SALEM05210/SLM' \
-d 'P74VPMT-18R86WXMM9
// highlight-next-line
VI{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.number" | pad_right: 19, "x" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_month" | to_string | pad_left: 2, "0" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_year" | to_string | slice: 2,2 }}00003319380000000000008407202NVF AB
VI{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.number" | pad_right: 19, "x" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm' }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy' }}00003319380000000000008407202NVF AB
XX XXX XXXXX XXXXXXX XX
USABBEVILLE LA70510-7288AC01YEI10000000014064
7930f35b3c06cffe FR1XXXXMTCSTO
Expand Down Expand Up @@ -247,8 +247,8 @@ curl 'https://api.basistheory.com/proxy' \
"creditCard": {
// highlight-start
"number": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\"}}",
"expirationMonth": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\"}}",
"expirationYear": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\"}}",
"expirationMonth": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm'}}",
"expirationYear": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy'}}",
"cvv": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.cvc\"}}"
// highlight-end
}
Expand All @@ -275,7 +275,7 @@ curl 'https://api.basistheory.com/proxy' \
"card": {
// highlight-start
"accountNumber": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"expirationDate": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" | pad_left: 2, \"0\" }}",
"expirationDate": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyymm' }}",
"securityCode": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.cvc\" }}"
// highlight-end
},
Expand Down Expand Up @@ -323,7 +323,7 @@ curl 'https://api.basistheory.com/proxy' \
"creditCard": {
// highlight-start
"cardNumber": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"expirationDate": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" }}-{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" | pad_left: 2, \"0\" }}",
"expirationDate": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy-mm' }}",
"cardCode": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.cvc\" }}"
// highlight-end
}
Expand Down Expand Up @@ -352,8 +352,8 @@ curl 'https://api.basistheory.com/proxy' \
"type": "card",
// highlight-start
"number": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"expiry_month": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" }}",
"expiry_year": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" }}"
"expiry_month": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm' }}",
"expiry_year": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy' }}"
// highlight-end
},
"amount": 6500,
Expand Down Expand Up @@ -387,7 +387,7 @@ curl 'https://api.basistheory.com/proxy' \
// highlight-start
--data-urlencode 'security_key=P4qR9sT2uY7vX1wA3bC8dL5zG6xK9yH2' \
--data-urlencode 'ccnumber={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.number" }}' \
--data-urlencode 'ccexp={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_month" }}{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.expiration_year" | to_string | slice: -2, 2 }}' \
--data-urlencode 'ccexp={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: "mmyyyy" }}' \
--data-urlencode 'cvv={{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: "$.data.cvc" }}'
// highlight-end
```
Expand All @@ -414,8 +414,8 @@ curl 'https://api.basistheory.com/proxy' \
// highlight-start
"cardNum": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.number\" }}",
"cardExpiry": {
"month": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_month\" | to_number }}",
"year": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.expiration_year\" | to_number }}"
"month": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'mm' | to_number }}",
"year": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | card_exp: 'yyyy' | to_number }}"
},
"cvv": "{{ token: d2cbc1b4-5c3a-45a3-9ee2-392a1c475ab4 | json: \"$.data.cvc\" }}",
// highlight-end
Expand Down
Loading