Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat: adds patch for atomic banks and cards #107

Merged
merged 4 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
87 changes: 87 additions & 0 deletions source/includes/api-reference/_atomic_banks.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,93 @@ Parameter | Required | Type | Default | Description
Returns an [Atomic Bank](#atomic-banks-atomic-bank-object) with the `id` provided. Returns [an error](#errors) if the Atomic Bank could not be retrieved.


## Update Atomic Bank

> Request

```shell
curl "https://api.basistheory.com/atomic/banks/1485efb9-6b1f-4248-a5d1-cf9b3907164c" \
-H "X-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-H "Content-Type: application/json" \
-X "PATCH" \
-d '{
"bank": {
"routing_number": "021000021",
"account_number": "1234567890"
},
}'
```

```javascript
import { BasisTheory } from '@basis-theory/basis-theory-js';

const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED');

const atomicBank = await bt.atomicBanks.update("1485efb9-6b1f-4248-a5d1-cf9b3907164c", {
bank: {
routingNumber: '021000021',
accountNumber: '1234567890',
},
});
```

```csharp
using BasisTheory.net.Atomic.Banks;

var client = new AtomicBankClient("key_N88mVGsp3sCXkykyN2EFED");

var atomicBank = await client.UpdateAsync("1485efb9-6b1f-4248-a5d1-cf9b3907164c", new UpdateAtomicBankRequest {
Bank = new Bank {
RoutingNumber = "021000021",
AccountNumber = "1234567890"
},
});
```

> Response

```json
{
"id": "1485efb9-6b1f-4248-a5d1-cf9b3907164c",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"type": "bank",
"bank": {
"routing_number": "021000021",
"account_number": "XXXXXX7890"
},
"fingerprint": "8j6WJgk4Dz1qoJgrHrioUFJhYKQTnk75DfJAue5bNab2",
"metadata": {
"nonSensitiveField": "Non-Sensitive Value"
},
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
koalaty-code marked this conversation as resolved.
Show resolved Hide resolved
}
```

<span class="http-method patch">
<span class="box-method">PATCH</span>
`https://api.basistheory.com/atomic/banks/{id}`
</span>

Update an Atomic Bank for the Tenant. At least one property on the request body is required.

### Permissions

<p class="scopes">
<span class="scope">bank:update</span>
</p>

### Request Parameters

Attribute | Required | Type | Default | Description
--------- | -------- | ---- | ------- | -----------
`bank` | true | *[bank](#atomic-banks-atomic-bank-object-bank-object)* | `null` | Bank data

### Response

Returns an [Atomic Bank](#atomic-banks-atomic-bank-object) with masked [bank data](#atomic-banks-atomic-bank-object-bank-object) if the Atomic Bank was updated. Returns [an error](#errors) if there were validation errors, or the Atomic Bank failed to update.


## Delete Atomic Bank

> Request
Expand Down
147 changes: 147 additions & 0 deletions source/includes/api-reference/_atomic_cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,153 @@ Parameter | Required | Type | Default | Description
Returns an [Atomic Card](#atomic-cards-atomic-card-object) with the `id` provided. Returns [an error](#errors) if the Atomic Card could not be retrieved.


## Update Atomic Card

> Request

```shell
curl "https://api.basistheory.com/atomic/cards/c1e565009-1984-4638-8fca-dce8a82cc2af" \
-H "X-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-H "Content-Type: application/json" \
-X "PATCH" \
-d '{
"card": {
"number": "4242424242424242",
"expiration_month": 12,
"expiration_year": 2025,
"cvc": "123"
},
"billing_details": {
"name": "John Doe",
"email": "johndoe@test.com",
"phone": "555-123-4567",
"address": {
"line1": "111 Test St.",
"line2": "Apt 304",
"city": "San Francisco",
"state": "CA",
"postal_code": "94141",
"country": "US"
}
}
}'
```

```javascript
import { BasisTheory } from '@basis-theory/basis-theory-js';

const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED');

const atomicCard = await bt.atomicCards.update("c1e565009-1984-4638-8fca-dce8a82cc2af", {
card: {
number: '4242424242424242',
expirationMonth: 12,
expirationYear: 2025,
cvc: '123',
},
billingDetails: {
name: 'John Doe',
email: 'johndoe@test.com',
phone: '555-123-4567',
address: {
line1: '111 Test St.',
line2: 'Apt 304',
city: 'San Francisco',
state: 'CA',
postalCode: '94141',
country: 'US'
},
}
});
```

```csharp
using BasisTheory.net.Atomic.Cards;

var client = new AtomicCardClient("key_N88mVGsp3sCXkykyN2EFED");

var atomicCard = await client.UpdateAsync("c1e565009-1984-4638-8fca-dce8a82cc2af", new UpdateAtomicCardRequest {
Card = new Card {
CardNumber = "4242424242424242",
ExpirationMonth = 12,
ExpirationYear = 2025,
CardVerificationCode = "123"
},
BillingDetails = new BillingDetails {
Name = "John Doe",
Email = "johndoe@test.com",
PhoneNumber = "555-123-4567",
Address = new Address {
LineOne = "111 Test St.",
LineTwo = "Apt 304",
City = "San Francisco",
State = "CA",
PostalCode = "94141",
Country = "US"
}
}
});
```

> Response

```json
{
"id": "c1e565009-1984-4638-8fca-dce8a82cc2af",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"type": "card",
"card": {
"number": "XXXXXXXXXXXX4242",
"expiration_month": 12,
"expiration_year": 2025
},
"billing_details": {
"name": "John Doe",
"email": "johndoe@test.com",
"phone": "555-123-4567",
"address": {
"line1": "111 Test St.",
"line2": "Apt 304",
"city": "San Francisco",
"state": "CA",
"postal_code": "94141",
"country": "US"
}
},
"fingerprint": "EVYsSLRyb86Z5awJksvnjVMEC4iP7KX639GtHVUFpzER",
"metadata": {
"nonSensitiveField": "Non-Sensitive Value"
},
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
koalaty-code marked this conversation as resolved.
Show resolved Hide resolved
}
```

<span class="http-method patch">
<span class="box-method">PATCH</span>
`https://api.basistheory.com/atomic/cards/{id}`
</span>

Update an Atomic Card for the Tenant. At least one property on the request body is required.

### Permissions

<p class="scopes">
<span class="scope">card:update</span>
</p>

### Request Parameters

Attribute | Required | Type | Default | Description
--------- | -------- | ---- | ------- | -----------
`card` | false | *[card](#atomic-cards-atomic-card-object-card-object)* | `null` | Card data
`billing_details` | false | *[billing details](#atomic-cards-atomic-card-object-billing-details-object)* | `null` | Billing details

### Response

Returns an [Atomic Card](#atomic-cards-atomic-card-object) with masked [card data](#atomic-cards-atomic-card-object-card-object) if the Atomic Card was updated. Returns [an error](#errors) if there were validation errors, or the Atomic Card failed to update.


## Delete Atomic Card

> Request
Expand Down
4 changes: 3 additions & 1 deletion source/javascripts/app/_copy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions source/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ $aside-danger-bg: #FB5B8B !default;
$search-notice-bg: #c97a7e !default;
$code-bg: rgba(26, 28, 51, 0.06) !default;
$http-method-post-bg: #3AC3A2 !default;
$http-method-patch-bg: #7E67F3 !default;
$http-method-delete-bg: #FB5B8B !default;
$http-method-get-border: #D4F2F4 !default;
$http-method-post-border: #C6EFE5 !default;
$http-method-patch-border: #D3CCF9 !default;
$http-method-delete-border: #FFDCDE !default;
$http-method-get-container-bg: #E9FEFF !default;
$http-method-post-container-bg: #E8FFF9 !default;
$http-method-patch-container-bg: #E9E4FF !default;
$http-method-delete-container-bg: #FFF0F1 !default;
$code-annotation-bg: #1B1D32 !default;

Expand Down
16 changes: 13 additions & 3 deletions source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ html, body {

&.get {
background: $http-method-get-container-bg;
border: 1px solid #D4F2F4;
border: 1px solid $http-method-get-border;

.box-method {
background-color: $primary;
Expand All @@ -717,17 +717,27 @@ html, body {

&.post, &.put {
background-color: $http-method-post-container-bg;
border: 1px solid #C6EFE5;
border: 1px solid $http-method-post-border;

.box-method {
background-color: $http-method-post-bg;
}

}

&.patch {
background-color: $http-method-patch-container-bg;
border: 1px solid $http-method-patch-border;

.box-method {
background-color: $http-method-patch-bg;
}

}

&.delete {
background-color: $http-method-delete-container-bg;
border: 1px solid #FFDCDE;
border: 1px solid $http-method-delete-border;

.box-method {
background-color: $http-method-delete-bg;
Expand Down