-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
695d10d
commit 37d687c
Showing
13 changed files
with
52 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package example | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/EasyPost/easypost-go/v4" | ||
"github.com/EasyPost/easypost-go/v3" | ||
) | ||
|
||
func main() { | ||
client := easypost.New("EASYPOST_API_KEY") | ||
|
||
fund := client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
|
||
fmt.Println(fund) | ||
client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package example | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/EasyPost/easypost-go/v2" | ||
) | ||
|
||
func main() { | ||
client := easypost.New("EASYPOST_API_KEY") | ||
|
||
fund := client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
|
||
fmt.Println(fund) | ||
client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package example | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/EasyPost/easypost-go/v3" | ||
) | ||
|
||
func main() { | ||
client := easypost.New("EASYPOST_API_KEY") | ||
|
||
fund := client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
|
||
fmt.Println(fund) | ||
client.FundWallet("2000", easypost.PrimaryPaymentMethodPriority) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
official/guides/partner-white-label-guide/node/configure-recharge.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
const Easypost = require('@easypost/api'); | ||
const api = new Easypost('<YOUR_PRODUCTION_API_KEY>'); | ||
const EasyPostClient = require('@easypost/api'); | ||
|
||
// If no user id is passed in, the user returned is the owner of the api key. | ||
api.User.retrieve('user_...').then((u) => { | ||
u.recharge_threshold = '50.00'; | ||
u.save().catch(console.error); | ||
}); | ||
const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
(async () => { | ||
let user; | ||
user = client.User.retrieveMe(); | ||
user = client.User.update(user.id, { recharge_threshold: '50.00' }); | ||
console.log(user); | ||
})(); |
9 changes: 6 additions & 3 deletions
9
official/guides/partner-white-label-guide/node/fund-wallet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
const Easypost = require('@easypost/api'); | ||
const api = new Easypost('<YOUR_PRODUCTION_API_KEY>'); | ||
const EasyPostClient = require('@easypost/api'); | ||
|
||
api.Billing.fund('2000', 'primary').then(console.log); | ||
const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
(async () => { | ||
client.Billing.fundWallet('2000', 'primary'); | ||
})(); |
13 changes: 9 additions & 4 deletions
13
official/guides/partner-white-label-guide/php/configure-recharge.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
<?php | ||
|
||
\EasyPost\EasyPost::setApiKey("<YOUR_PRODUCTION_API_KEY>"); | ||
$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
$me = \EasyPost\User::retrieve_me(); | ||
$me->recharge_threshold = "50.00"; | ||
$me->save(); | ||
$user = $client->user->retrieveMe(); | ||
|
||
$updatedUser = $client->user->update( | ||
$user->id, | ||
['recharge_threshold' => '50.00'] | ||
); | ||
|
||
echo $updatedUser; |
7 changes: 4 additions & 3 deletions
7
official/guides/partner-white-label-guide/php/fund-wallet.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require_once("../lib/easypost.php"); | ||
\EasyPost\EasyPost::setApiKey("<YOUR_PRODUCTION_API_KEY>"); | ||
<?php | ||
|
||
$success = Billing::fund_wallet(2000, 'primary'); | ||
$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
$client->billing->fundWallet(2000, 'primary'); |
10 changes: 6 additions & 4 deletions
10
official/guides/partner-white-label-guide/python/configure-recharge.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import easypost | ||
|
||
easypost.api_key = "<YOUR_PRODUCTION_API_KEY>" | ||
client = easypost.EasyPostClient("EASYPOST_API_KEY") | ||
|
||
me = easypost.User.retrieve() | ||
me.recharge_threshold = "50.00" | ||
me.save() | ||
user = client.user.retrieve_me() | ||
|
||
updated_user = client.user.update(user.id, recharge_threshold="50.00") | ||
|
||
print(updated_user) |
4 changes: 2 additions & 2 deletions
4
official/guides/partner-white-label-guide/python/fund-wallet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import easypost | ||
|
||
easypost.api_key = "<YOUR_PRODUCTION_API_KEY>" | ||
client = easypost.EasyPostClient("EASYPOST_API_KEY") | ||
|
||
success = easypost.Billing.fund_wallet( | ||
client.billing.fund_wallet( | ||
amount="2000", | ||
primary_or_secondary="primary", | ||
) |
11 changes: 7 additions & 4 deletions
11
official/guides/partner-white-label-guide/ruby/configure-recharge.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
require 'easypost' | ||
EasyPost.api_key = '<YOUR_PRODUCTION_API_KEY>' | ||
|
||
me = EasyPost::User.retrieve_me | ||
me.recharge_threshold = '50.00' | ||
me.save | ||
client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') | ||
|
||
retrieved_user = client.user.retrieve_me | ||
|
||
user = client.user.update(retrieved_user.id, recharge_amount: '50.00') | ||
|
||
puts user |
5 changes: 3 additions & 2 deletions
5
official/guides/partner-white-label-guide/ruby/fund-wallet.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'easypost' | ||
EasyPost.api_key = '<YOUR_PRODUCTION_API_KEY>' | ||
|
||
EasyPost::Billing.fund('2000', 'primary') | ||
client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') | ||
|
||
client.billing.fund_wallet('2000', 'primary') |