Skip to content
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
5 changes: 4 additions & 1 deletion official/docs/csharp/current/webhooks/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public static async Task Main()
{
Url = "example.com",
Secret = "ABC123",
CustomHeaders = new EasyPost.Models.API.WebhookCustomHeader { Name = "X-Header-Name", Value = "header_value" }
CustomHeaders = new List<EasyPost.Models.API.WebhookCustomHeader>
{
new EasyPost.Models.API.WebhookCustomHeader { Name = "X-Header-Name", Value = "header_value" }
}
};

EasyPost.Models.API.Webhook webhook = await client.Webhook.Create(parameters);
Expand Down
5 changes: 4 additions & 1 deletion official/docs/csharp/current/webhooks/update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public static async Task Main()
EasyPost.Parameters.Webhook.Create parameters = new()
{
Secret = "ABC123",
CustomHeaders = new EasyPost.Models.API.WebhookCustomHeader { Name = "X-Header-Name", Value = "header_value" }
CustomHeaders = new List<EasyPost.Models.API.WebhookCustomHeader>
{
new EasyPost.Models.API.WebhookCustomHeader { Name = "X-Header-Name", Value = "header_value" }
}
};

EasyPost.Models.API.Webhook webhook = await client.Webhook.Update("hook_...", parameters);
Expand Down
11 changes: 6 additions & 5 deletions official/docs/java/current/webhooks/create.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ public static void main(String[] args) throws EasyPostException {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("url", "example.com");
params.put("webhook_secret", "A1B2C3");
params.put("custom_headers", new HashMap<String, String>() {
{
put("X-Header-Name", "header_value");
}
});
ArrayList<HashMap<String, String>> customHeaders = new ArrayList<>();
HashMap<String, String> header = new HashMap<>();
header.put("name", "X-Header-Name");
header.put("value", "header_value");
customHeaders.add(header);
params.put("custom_headers", customHeaders);

Webhook webhook = client.webhook.create(params);

Expand Down
11 changes: 6 additions & 5 deletions official/docs/java/current/webhooks/update.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ public static void main(String[] args) throws EasyPostException {

HashMap<String, Object> params = new HashMap<String, Object>();
params.put("webhook_secret", "A1B2C3");
params.put("custom_headers", new HashMap<String, String>() {
{
put("X-Header-Name", "header_value");
}
});
ArrayList<HashMap<String, String>> customHeaders = new ArrayList<>();
HashMap<String, String> header = new HashMap<>();
header.put("name", "X-Header-Name");
header.put("value", "header_value");
customHeaders.add(header);
params.put("custom_headers", customHeaders);

Webhook webhook = client.webhook.update("hook_...", params);

Expand Down
9 changes: 6 additions & 3 deletions official/docs/node/current/webhooks/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const client = new EasyPostClient('EASYPOST_API_KEY');
const webhook = await client.Webhook.create({
url: 'example.com',
webhook_secret: 'A1B2C3',
customer_headers: {
'X-Header-Name': 'header_value',
},
customer_headers: [
{
name: 'X-Header-Name',
value: 'header_value',
},
],
});

console.log(webhook);
Expand Down
9 changes: 6 additions & 3 deletions official/docs/node/current/webhooks/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const client = new EasyPostClient('EASYPOST_API_KEY');
(async () => {
const webhook = await client.Webhook.update('hook_...', {
webhook_secret: 'A1B2C3',
customer_headers: {
'X-Header-Name': 'header_value',
},
customer_headers: [
{
name: 'X-Header-Name',
value: 'header_value',
},
],
});

console.log(webhook);
Expand Down
3 changes: 2 additions & 1 deletion official/docs/php/current/webhooks/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
'url' => 'example.com',
'webhook_secret' => 'A1B2C3',
'custom_headers' => [
'X-Header-Name' => 'header_value',
['name' => 'X-Header-Name'],
['value' => 'header_value'],
],
]);

Expand Down
5 changes: 3 additions & 2 deletions official/docs/php/current/webhooks/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
$webhook = $client->webhook->update('hook_...', [
'webhook_secret' => 'A1B2C3',
'custom_headers' => [
'X-Header-Name' => 'header_value',
]
['name' => 'X-Header-Name'],
['value' => 'header_value'],
],
]);

echo $webhook;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
client = easypost.EasyPostClient("EASYPOST_API_KEY")

payment_method = client.referral_customer.add_bank_account_from_stripe(
referral_api_key="REFERRAL_CUSTOMER_PROD_API_KEY",
referral_api_key="REFERRAL_USER_API_KEY",
financial_connections_id="fca_...",
mandate_data={
"ip_address": "127.0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
client = easypost.EasyPostClient("EASYPOST_API_KEY")

payment_method = client.referral_customer.add_credit_card_from_stripe(
referral_api_key="REFERRAL_CUSTOMER_PROD_API_KEY",
financial_connections_id="seti_...",
referral_api_key="REFERRAL_USER_API_KEY",
payment_method_id="seti_...",
priority="primary",
)

Expand Down
9 changes: 6 additions & 3 deletions official/docs/python/current/webhooks/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
webhook = client.webhook.create(
url="example.com",
webhook_secret="A1B2C3",
custom_headers={
"X-Header-Name": "header_value",
},
custom_headers=[
{
"name": "X-Header-Name",
"value": "header_value",
}
],
)

print(webhook)
9 changes: 6 additions & 3 deletions official/docs/python/current/webhooks/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
updated_webhook = client.webhook.update(
"hook_...",
webhook_secret="A1B2C3",
custom_headers={
"X-Header-Name": "header_value",
},
custom_headers=[
{
"name": "X-Header-Name",
"value": "header_value",
}
],
)

print(updated_webhook)
9 changes: 6 additions & 3 deletions official/docs/ruby/current/webhooks/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
webhook = client.webhook.create(
url: 'example.com',
webhook_secret: 'A1B2C3',
custom_headers: {
'X-Header-Name' => 'header_value',
},
custom_headers: [
{
name: 'X-Header-Name',
value: 'header_value',
},
],
)

puts webhook
9 changes: 6 additions & 3 deletions official/docs/ruby/current/webhooks/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
webhook = client.webhook.update(
'hook_...', {
webhook_secret: 'A1B2C3',
custom_headers: {
'X-Header-Name' => 'header_value',
},
custom_headers: [
{
name: 'X-Header-Name',
value: 'header_value',
},
],
},
)

Expand Down
Loading