Skip to content

Instantly share code, notes, and snippets.

@New0
Last active August 12, 2017 20:40
Show Gist options
  • Save New0/62af7b5c5f1a0017ffc71d6dc22a8d97 to your computer and use it in GitHub Desktop.
Save New0/62af7b5c5f1a0017ffc71d6dc22a8d97 to your computer and use it in GitHub Desktop.
WAIT FOR UPDATE TO 2.1.0 DIrect Stripe Update Customer's Card Number in Stripe
add_filter( 'ds_charge_action_payment', function( $action ) {
$action = '\Stripe\Customer::retrieve';
return $action;
}, 10);
add_filter( 'ds_charge_content_payment', function( $content, $token, $stripe_id ) {
$content = $stripe_id;
return $content;
}, 10, 3);
add_action( 'ds_after_charge_payment_process', function( $customer, $token ) {
$customer->source = $token;
$customer->save();
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment