• Resolved virtual03

    (@virtual03)


    Hi,
    
    is it possible to edit the order amount later if the payment is only authorized so that the correct amount is debited at the end?
    
    best regards
    Daniel
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    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,

    Thread Starter virtual03

    (@virtual03)

    ok thank you, only in my case the amount should be bigger and not smaller. how can we achieve this?

    Plugin Author Payment Plugins

    (@mrclayton)

    @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,

    Thread Starter virtual03

    (@virtual03)

    what do you mean by that? is there any documentation about it?

    Plugin Author Payment Plugins

    (@mrclayton)

    @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;
    });
    Thread Starter virtual03

    (@virtual03)

    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

    Plugin Author Payment Plugins

    (@mrclayton)

    @virtual03 yeah that was just an example, we didn’t have time to actually test that. Remove the $order attribute and it should work.

    Thread Starter virtual03

    (@virtual03)

    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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘subsequently edit the order amount’ is closed to new replies.