Last active
March 31, 2019 09:52
-
-
Save New0/69100a1d6ba749c0e15d03cef9a4481b to your computer and use it in GitHub Desktop.
Add-on for Direct Stripe in order to declare the Cross Border Classification as metadata in payments and subscriptions
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
<?php | |
/* | |
* Plugin Name: DS Cross Border Classification | |
* Author: Nicolas Figueira | |
* Author URI: https://newo.me | |
* Description: Declare Cross Border Classification during Direct Stripe transactions | |
* Plugin URI: https://gist.github.com/New0/69100a1d6ba749c0e15d03cef9a4481b/edit | |
* Version: 1.0.0 | |
*/ | |
function ds_cbc($data, $user, $token, $button_id) { | |
$data[] = array( | |
"metadata" => array( | |
"cross_border_classification" => "export" | |
) | |
); | |
return $data; | |
} | |
add_action( 'direct_stripe_charge_data', 'ds_cbc', 10, 4 ); | |
add_action( 'direct_stripe_subscription_data', 'ds_cbc', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment