Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active August 9, 2018 08:10
Show Gist options
  • Select an option

  • Save vanbo/1a2bc415683347ff63d06b110653c579 to your computer and use it in GitHub Desktop.

Select an option

Save vanbo/1a2bc415683347ff63d06b110653c579 to your computer and use it in GitHub Desktop.
Paysafe: Add accordD financing parameter
// Normal order
add_filter( 'wc_paysafe_request_params', 'prefix_add_accordd', 10, 2 );
// Subscriptions/Pre-Orders order
add_filter( 'wc_paysafe_addons_request_params', 'prefix_add_accordd', 10, 2 );
function prefix_add_accordd( $params, $order ) {
$params['accordD'] = array(
// This is the type of financing offered. Possible values are:
// DEFERRED_PAYMENT – Deferred payment financing
// EQUAL_PAYMENT – Equal payment financing
'financingType' => 'EQUAL_PAYMENT', // Required
// This is the plan number for this financing transaction.
'plan' => '123', // Required
// This is the grace period, in months, associated with deferred payment transactions.
'gracePeriod' => 1, // Optional
// This is the number of payments, in months, for equal payment transactions.
'term' => 12, // Optional
);
return $params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment