Skip to content

Instantly share code, notes, and snippets.

@joeyemery
Created January 11, 2018 11:45
Show Gist options
  • Save joeyemery/00eacc1dc768df860dc63cef4793b5b9 to your computer and use it in GitHub Desktop.
Save joeyemery/00eacc1dc768df860dc63cef4793b5b9 to your computer and use it in GitHub Desktop.
try {
$charge = \Stripe\Charge::create(array(
"amount" => $message->price * 100,
"currency" => "gbp",
// "source" => $connected_customer->id,
"source" => $token->id,
), array("stripe_account" => $message->user->stripe_merchant_id));
} catch (\Stripe\Error\RateLimit $e) {
return [];
} catch (\Stripe\Error\InvalidRequest $e) {
return [];
} catch (\Stripe\Error\Authentication $e) {
return [];
} catch (\Stripe\Error\ApiConnection $e) {
return [];
} catch (\Stripe\Error\Base $e) {
return [];
} catch (Exception $e) {
return [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment