Hi @virtual03
Yes, that is one of the reasons you would authorize a payment, so that you can later edit the captured amount.
The captured amount cannot exceed the authorized amount, it can only be less than the original authorized amount.
Kind Regards,
ok thank you, only in my case the amount should be bigger and not smaller. how can we achieve this?
@virtual03 Then you should ensure your authorized amount is as great as the potential capture amount.
You could use the Stripe plugin’s provided filters to update the amount sent to Stripe. That value could be for something greater than the order total.
Filter: wc_stripe_payment_intent_args
Property: amount
.
Kind Regards,
what do you mean by that? is there any documentation about it?
@virtual03 Filters are used extensively in WordPress and plugins. They are what allow you to customize the platform.
I recommend you read some of the well written articles about what filters are and how they work.
Example: This adds a 5% increase to the authorized amount, so you can later capture up to 5% more than the order amount.
add_filter('wc_stripe_payment_intent_args', function($args, $order){
$args['amount'] = $args['amount'] + $args['amount'] * 0.05;
return $args;
});
ok super, I have to deal with the topic. I tried the code but there are internal errors in the checkout. A code would be enough for me just to test it.
thanks
@virtual03 yeah that was just an example, we didn’t have time to actually test that. Remove the $order attribute and it should work.
now works however the 5% will be authorized immediately and when the order is processed the price will not change anymore. thanks for the help
best regards
Daniel