Skip to content

Instantly share code, notes, and snippets.

View ehongyu's full-sized avatar

Hongyu Zhang ehongyu

View GitHub Profile
$payout = \Stripe\Payout::create(
[
"amount" => 1000,
"currency" => "usd",
"destination" => 'ba_1ALJm3HxNV2Q6NSzVM3yHukM',
],
[
'stripe_account' => 'acct_1ALJlyHxNV2Q6NSz'
]
);
<?php
// include stripe PHP lib path here
// set up API key
\Stripe\Stripe::setApiKey("your API key here");
$managed_account = \Stripe\Account::create([
'managed' => true,
'email' => 'test@tradesy.com'
]);
<?php
// put your autoloader path here
\Stripe\Stripe::setApiKey('secret'); // put your secret key here
$account = \Stripe\Account::create([
'managed' => true,
'email' => 'test@tradesy.com'
]);
@ehongyu
ehongyu / gist:96dee71e016effcb3488a7e324b1448b
Created January 12, 2017 23:26
Link a recipient card to a managed account
// create a new debit card recipient
$token = \Stripe\Token::create(array(
'card' => $this->debit_card,
));
$recipient = \Stripe\Recipient::create(array(
"name" => $this->name,
"type" => "individual",
'card' => $token->id
<?php
require '../../vendor/autoload.php';
define('AMQP_DEBUG', false);
$conn = new \PhpAmqpLib\Connection\AMQPStreamConnection(
'localhost', '5672', 'guest', 'guest', '/');
var_dump(count($conn->channels));
$ch1 = $conn->channel(1);
var_dump(count($conn->channels));
$queue1 = 'q1';
$ch1->queue_declare($queue1, false, true, false, false);