Skip to content

Commit

Permalink
DEV-1568: Update links and mentions to Integration examples (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyaThapa authored May 6, 2024
1 parent 0f3ac15 commit b939536
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 41 deletions.
4 changes: 2 additions & 2 deletions assets/api-resource-tables/exchanges/CreateExchange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default {
"conditional",
"string",
<span>
A third party provider processor token. <strong>Required</strong> for MX
and Flinks integrations.
A third party provider processor token. <strong>Required</strong> for
MX, Flinks, and Plaid integrations.
</span>,
],
[
Expand Down
27 changes: 13 additions & 14 deletions pages/code-samples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,29 @@ export const CodeSamplesPageGrid = () => {
};
const codeSampleCards = [
{
topic: "Dwolla + Plaid Integration Example",
topic: "Dwolla + Plaid Token Exchange",
description: (
<>
Example app built using Next.js to demonstrate how to add a verified
bank funding source using the{" "}
<a href={"./guides/plaid"}>tokenized integration</a> between Dwolla
and Plaid.
</>
<p>
A Next.js application connecting Dwolla and Plaid via Dwolla's Token
Exchange, which allows Dwolla to securely retrieve sensitive
information (e.g., account and routing numbers) directly from Plaid.
</p>
),
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/plaid-funding-source",
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/secure-token-exchange/plaid",
external: true,
languages: ["JavaScript", "TypeScript"],
},
{
topic: "Dwolla + Finicity Token Exchange",
topic: "Dwolla + Mastercard Token Exchange",
description: (
<p>
A Next.js application connecting Dwolla and Finicity via Dwolla's
A Next.js application connecting Dwolla and Mastercard via Dwolla's
Token Exchange, which allows Dwolla to securely retrieve sensitive
information (e.g., account and routing numbers) directly from
Finicity.
Mastercard.
</p>
),
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/finicity-token-exchange",
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/secure-token-exchange/mastercard",
external: true,
languages: ["JavaScript", "TypeScript"],
},
Expand All @@ -53,7 +52,7 @@ export const CodeSamplesPageGrid = () => {
information (e.g., account and routing numbers) directly from MX.
</p>
),
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/mx-token-exchange",
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/secure-token-exchange/mx",
external: true,
languages: ["JavaScript", "TypeScript"],
},
Expand All @@ -66,7 +65,7 @@ export const CodeSamplesPageGrid = () => {
information (e.g., account and routing numbers) directly from Flinks.
</p>
),
href: "https://github.com/Dwolla/integration-examples/tree/main/packages/flinks-token-exchange",
href: "https://github.com/Dwolla/integration-examples/blob/main/packages/secure-token-exchange/flinks",
external: true,
languages: ["JavaScript", "TypeScript"],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ This section contains information on how to create an exchange for an end-user/C
### Request parameters

| Parameter | Required | Type | Description |
| --------- | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_links | yes | object | A \_links JSON object containing an exchange partner link. See example raw request and response below. |
| token | conditional | string | A third party provider processor token. **Required** for MX and Flinks integrations. |
| finicity | conditional | object | Finicity resource object containing access key **receipt** information. **Required** for Finicity integration. See `finicity` JSON object below (including nested `product` and `accessPeriod` JSON objects). |
| Parameter | Required | Type | Description |
| --------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_links | yes | object | A \_links JSON object containing an exchange partner link. See example raw request and response below. |
| token | conditional | string | A third party provider processor token. **Required** for MX, Flinks and Plaid integrations. |
| finicity | conditional | object | Finicity resource object containing access key **receipt** information. **Required** for Mastercard integration. See `finicity` JSON object below (including nested `product` and `accessPeriod` JSON objects). |

### Finicity JSON Object

Expand Down Expand Up @@ -344,7 +344,7 @@ dwolla
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

### Request and Response (Finicity)
### Request and Response (Mastercard)

```bash
POST https://api.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980/exchanges
Expand Down Expand Up @@ -528,3 +528,93 @@ dwolla
.post(`${customerUrl}/exchanges`, requestBody)
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

### Request and Response (Plaid)

```bash
POST https://api.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980/exchanges
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

{
"_links": {
"exchange-partner": {
"href": "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
}
},
"token": "somePlaidProcessorToken"
}

HTTP/1.1 201 Created
Location: https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d
```

```php
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$exchangesApi = new ExchangesApi($apiClient);
$customerUrl = "https://api-sandbox.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980";

$exchange = $exchangesApi->createCustomerExchange(new CreateExchangeRequest([
"_links" => [
"exchange-partner" => [
"href" => "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
]
],
"token" => "somePlaidProcessorToken"
]), $customerUrl);

$exchange; # => https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d
?>
```

```ruby
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
customer_url = 'https://api.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980'
request_body = {
_links: {
'exchange-partner': {
href: "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
}
},
token: 'somePlaidProcessorToken'
}

exchange = app_token.post "#{customer_url}/exchanges", request_body
exchange.response_headers[:location] # => "https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d"
```

```python
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
customer_url = 'https://api.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980'
request_body = {
'_links': {
'exchange-partner': {
'href': 'https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d'
}
},
'token': 'somePlaidProcessorToken'
}

exchange = app_token.post('%s/exchanges' % customer_url, request_body)
exchange.headers['location'] # => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

```javascript
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var customerUrl =
"https://api.dwolla.com/customers/74a207b2-b7b7-4efa-8bf8-582148e7b980";
var requestBody = {
_links: {
"exchange-partner": {
href: "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d",
},
},
token: "somePlaidProcessorToken",
};

dwolla
.post(`${customerUrl}/exchanges`, requestBody)
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ This section contains information on how to create an exchange for a reseller pa
### Request parameters

| Parameter | Required | Type | Description |
| --------- | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_links | yes | object | A \_links JSON object containing an exchange partner link. See example raw request and response below. |
| token | conditional | string | A third party provider processor token. **Required** for MX and Flinks integrations. |
| finicity | conditional | object | Finicity resource object containing access key **receipt** information. **Required** for Finicity integration. See `finicity` JSON object below (including nested `product` and `accessPeriod` JSON objects). |
| Parameter | Required | Type | Description |
| --------- | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_links | yes | object | A \_links JSON object containing an exchange partner link. See example raw request and response below. |
| token | conditional | string | A third party provider processor token. **Required** for MX, Flinks and Plaid integrations. |
| finicity | conditional | object | Finicity resource object containing access key **receipt** information. **Required** for Mastercard integration. See `finicity` JSON object below (including nested `product` and `accessPeriod` JSON objects). |

#### Finicity JSON Object

Expand Down Expand Up @@ -250,7 +250,7 @@ dwolla
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

### Request and Response (Finicity)
### Request and Response (Mastercard)

```bash
POST https://api.dwolla.com/exchanges
Expand Down Expand Up @@ -429,3 +429,88 @@ dwolla
.post("exchanges", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

### Request and Response (Plaid)

```bash
POST https://api.dwolla.com/exchanges
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

{
"_links": {
"exchange-partner": {
"href": "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
}
},
"token": "somePlaidProcessorToken"
}

HTTP/1.1 201 Created
Location: https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d
```

```php
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$exchangesApi = new ExchangesApi($apiClient);

$exchange = $exchangesApi->createAccountExchange(new CreateExchangeRequest([
"_links" => [
"exchange-partner" => [
"href" => "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
]
],
"token" => "somePlaidProcessorToken"
]));

$exchange; # => https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d
?>
```

```ruby
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
request_body = {
_links: {
'exchange-partner': {
href: "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d"
}
},
token: 'somePlaidProcessorToken'
}

exchange = app_token.post "exchanges", request_body
exchange.response_headers[:location] # => "https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d"
```

```python
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'_links': {
'exchange-partner': {
'href': 'https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d'
}
},
'token': 'somePlaidProcessorToken'
}

exchange = app_token.post('exchange', request_body)
exchange.headers['location'] # => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```

```javascript
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
_links: {
"exchange-partner": {
href: "https://api.dwolla.com/exchange-partners/3aef60d1-878f-4692-8c06-c6b478efb60d",
},
},
token: "somePlaidProcessorToken",
};

dwolla
.post("exchanges", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchanges/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
```
Loading

0 comments on commit b939536

Please sign in to comment.