• thetallone

    (@thetallone)


    Hi there,

    I’m having issues with the AfterPay gateway when an order contains a product bundle.

    The error I’m seeing in the payment gateway logs indicated no price is set: items[0].price must be greater than or equal to 0

    Does that give you any ideas as to where the issue might be? Even if you can’t get a fix immediately, a nudge in the right direction might mean I can.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter thetallone

    (@thetallone)

    I’ve tracked this down to the bundles setting a negative price to a cart item to achieve the bundle discount. Example:

    Bundle product requires 4 products
    Each product is $30, Bundle is set to have fixed discount of $20 ($100 total).

    This is how AfterPay receives the information:

    [items] => Array
            (
                [0] => Array
                    (
                        [name] => Product Bundle
                        [sku] => 
                        [quantity] => 1
                        [price] => Array
                            (
                                [amount] => -20.00
                                [currency] => AUD
                            )
    
                    )
    
                [1] => Array
                    (
                        [name] => Product name 1
                        [sku] => AAA1
                        [quantity] => 2
                        [price] => Array
                            (
                                [amount] => 30.00
                                [currency] => AUD
                            )
    
                    )
    
                [2] => Array
                    (
                        [name] => Product name 2
                        [sku] => AAA2
                        [quantity] => 1
                        [price] => Array
                            (
                                [amount] => 30.00
                                [currency] => AUD
                            )
    
                    )
    
                [3] => Array
                    (
                        [name] => Product name 3
                        [sku] => AAA3
                        [quantity] => 1
                        [price] => Array
                            (
                                [amount] => 30.00
                                [currency] => AUD
                            )
    
                    )
    
            )

    As the first item has a negative value, the order fails.

    This does not seem to be the case if a % discount is set on the bundle, or if you enable a fixed price for the bundle.

    To resolve: can you make the ‘discount amount’ NOT a negatively priced item? Alternatively, what is the difference between setting a fixed price for the bundle vs setting a discount amount for the bundle (aside from a user interface perspective)?

    Plugin Author WPClever

    (@wpclever)

    Hi @thetallone ,

    Thanks for contacting us. I’ll write a note to our developers for them to look into and check if there’s a valid solution to this. I’ll keep you posted if there is any news from our developers.

    Best regards.

    @wpclever is there an eta on when this will be fixed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Doesn’t work with AfterPay’ is closed to new replies.