Skip to content

Commit

Permalink
added pmpro_stripe_charge_params filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed Sep 2, 2020
1 parent d938624 commit 582f545
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions classes/gateways/class.pmprogateway_stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -1580,13 +1580,22 @@ function charge( &$order ) {

//charge
try {
$response = Stripe_Charge::create( array(
$params = array(
"amount" => $amount * $currency_unit_multiplier, # amount in cents, again
"currency" => strtolower( $pmpro_currency ),
"customer" => $this->customer->id,
"description" => apply_filters( 'pmpro_stripe_order_description', "Order #" . $order->code . ", " . trim( $order->FirstName . " " . $order->LastName ) . " (" . $order->Email . ")", $order )
)
);
);
/**
* Filter params used to create the Stripe charge.
*
* @since 2.4.4
*
* @param array $params Array of params sent to Stripe.
* @param object $order Order object for this checkout.
*/
$params = apply_filters( 'pmpro_stripe_charge_params', $params, $order );
$response = Stripe_Charge::create( $params );
} catch ( \Throwable $e ) {
//$order->status = "error";
$order->errorcode = true;
Expand Down

0 comments on commit 582f545

Please sign in to comment.