Last active
May 2, 2018 16:24
-
-
Save mehul0810/b4842744fa6de1f9b1f5d3ecaf0dc967 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
$source_args = apply_filters( 'give_stripe_get_source_args', array( | |
'type' => 'card', | |
'token' => $token_id, | |
) ); | |
$charge_options = array(); | |
if ( give_is_stripe_connected() ) { // This ensures that stripe is connected using Connect API. | |
$charge_options['stripe_account'] = give_get_option( 'give_stripe_user_id' ); | |
} | |
// Create source from token. | |
$source = \Stripe\Source::create( $source_args, $charge_options ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment