Skip to content

Instantly share code, notes, and snippets.

@New0
Last active March 31, 2019 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save New0/69100a1d6ba749c0e15d03cef9a4481b to your computer and use it in GitHub Desktop.
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
<?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