<p>Just trying to make a merchandise web shop with Craft CMS 3 and Craft Commerce 3. However, whenever payment is attempted to be made for merchandise on checkout page with commerce/payments/pay, there is the flash error: &quot;Invalid payment or order. Please Review.&quot;</p>
<p>There is nothing listed in attempted payments in the craft commerce Orders tab, and there is nothing in the logs tab either.</p>
<p>My html form for posting payment looks like:</p>
<pre><code>&lt;form method=&quot;POST&quot; class=&quot;form-horizontal&quot; id=&quot;paymentForm&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;commerce/payments/pay&quot;/&gt;
&lt;input type=&quot;hidden&quot; name=&quot;redirect&quot; value=&quot;{{'/shop/complete?number={number}'|hash}}&quot;/&gt;
&lt;input type=&quot;hidden&quot; name=&quot;cancelUrl&quot; value=&quot;{{'/shop/checkout'|hash}}&quot;/&gt;
{{ csrfInput() }}
                            
{% if cart.itemTotal == &quot;0&quot; %}
    &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary btn-lg&quot;&gt;Complete Order&lt;/button&gt;

{% elseif cart.itemTotal &gt; &quot;0&quot; %}
{% set stripeGatewayId = &quot;3&quot; %}
{% set stripeGateway = craft.commerce.gateways.getGatewayById(stripeGatewayId) %}
                                    
&lt;noscript&gt;
&lt;div class=&quot;alert alert-danger&quot;&gt;
&lt;h4&gt;JavaScript is not enabled!&lt;/h4&gt;
            
&lt;p&gt;This payment form requires your browser to have JavaScript enabled. Please activate JavaScript and reload this page. Check &lt;a
                                                            href=&quot;http://enable-javascript.com&quot; target=&quot;_blank&quot;&gt;enable-javascript.com&lt;/a&gt;for more informations.&lt;/p&gt;
&lt;/div&gt;
&lt;/noscript&gt;

&lt;span class=&quot;payment-success&quot;&gt;&lt;/span&gt;           
                
&lt;script src=&quot;https://checkout.stripe.com/checkout.js&quot;&gt;&lt;/script&gt;
                
&lt;div id=&quot;payment-request-button&quot; style=&quot;display: inline-block; width: 100px; vertical-align: middle&quot;&gt;
&lt;!-- A Stripe Element will be inserted here. --&gt;
&lt;/div&gt;
                
&lt;button id=&quot;stripeButton&quot; class=&quot;btn btn-primary btn-lg&quot;&gt;Pay with Card&lt;/button&gt;
                
{% set amount = cart.totalPrice|commerceCurrency(cart.paymentCurrency,convert=true,format=false) * 100 %}
{% set description = names|join(', ') %}
                
&lt;script&gt;
var stripeDone = function(token) {
$('#paymentForm').append($('&lt;input&gt;').attr({ type: 'hidden', name: 'stripeToken', value: token.id })).submit();
};
                    
var handler = StripeCheckout.configure({
key: '{{ stripeGateway.settings.publishableKey ?? '' }}',
locale: 'auto',
token: stripeDone
});
                    
document.getElementById('stripeButton').addEventListener('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'AMSS',
description: '{{ description }}',
email: '{{ cart.email }}',
currency: '{{ cart.paymentCurrency|lower }}',
amount: {{ amount }}
});
e.preventDefault();
});

// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
handler.close();
});
&lt;/script&gt;
                            
&lt;script src=&quot;https://js.stripe.com/v3/&quot;&gt;&lt;/script&gt;
                                                
&lt;script&gt;
var stripe = Stripe('{{ stripeGateway.settings.publishableKey ?? '' }}');
                
var paymentRequest = stripe.paymentRequest({
country: 'AU',
currency: '{{ cart.paymentCurrency|lower }}',
total: {
    label: '{{ description }}',
    amount: {{ amount }},
    },
});
                
var elements = stripe.elements();
var prButton = elements.create('paymentRequestButton', {
    paymentRequest: paymentRequest,
    style: {
    paymentRequestButton: {
        height: '45px'
            },
        },
    });
                
// Check the availability of the Payment Request API first.
paymentRequest.canMakePayment().then(function(result) {
if (result) {
prButton.mount('#payment-request-button');
} else {
document.getElementById('payment-request-button').style.display = 'none';
}
});
                
paymentRequest.on('token', function(ev) {
stripeDone(ev.token);
});
&lt;/script&gt;
{% endif %}
&lt;/form&gt;
</code></pre>
<p>My html form for adding the merchandise to cart looks like (which add manages to add cart successfully and can be seen in backend):</p>
<pre><code>&lt;form method=&quot;POST&quot; id=&quot;product-form&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;commerce/cart/update-cart&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;redirect&quot; value=&quot;{{ (craft.app.request.getQueryParam('next') ?: (product.defaultVariant.maxQty == 1 ? 'shop/checkout' : (product.type == 'merchandise' ? 'merchandise' : product.url)~'?showCart=1'))|hash }}&quot;&gt;
                        
&lt;input type=&quot;hidden&quot; name=&quot;redirect&quot; value=&quot;{{'merchandise'|hash}}&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;qty&quot; value=&quot;1&quot;&gt;
{{ csrfInput() }}

</code></pre>
<p>Any help on the error would be much appreciated</p>

CC BY-SA 4.0
2021-07-12T15:38:51.317Z
What gateway are you using? I don’t see ``cart.gateway.getPaymentFormHtml()`` in your code at all?
RitterKnight
CC BY-SA 4.0
2021-07-13T03:41:27.853Z
Sorry, I have now added it in the response
Steven Zhang
<craft3><plugin-craftcommerce><plugin-craftcommerce3><stripe><payment>
craft commerce "Invalid payment or order. Please Review." on hasFlash('error')
# craft commerce "Invalid payment or order. Please Review." on hasFlash('error')

(Asked by: username_0 on 2021-07-11)

Just trying to make a merchandise web shop with Craft CMS 3 and Craft Commerce 3. However, whenever payment is attempted to be made for merchandise on checkout page with commerce/payments/pay, there is the flash error: "Invalid payment or order. Please Review."
There is nothing listed in attempted payments in the craft commerce Orders tab, and there is nothing in the logs tab either.
My html form for posting payment looks like:




{{ csrfInput() }}
                            
{% if cart.itemTotal == "0" %}
    Complete Order

{% elseif cart.itemTotal > "0" %}
{% set stripeGatewayId = "3" %}
{% set stripeGateway = craft.commerce.gateways.getGatewayById(stripeGatewayId) %}
                                    


JavaScript is not enabled!
            
This payment form requires your browser to have JavaScript enabled. Please activate JavaScript and reload this page. Check enable-javascript.comfor more informations.



           
                

                



                
Pay with Card
                
{% set amount = cart.totalPrice|commerceCurrency(cart.paymentCurrency,convert=true,format=false) * 100 %}
{% set description = names|join(', ') %}
                

                            

                                                

{% endif %}


My html form for adding the merchandise to cart looks like (which add manages to add cart successfully and can be seen in backend):



                        


{{ csrfInput() }}


Any help on the error would be much appreciated

**Tags:** craft3, plugin-craftcommerce, plugin-craftcommerce3, stripe, payment

> **Comments:**
> **username_1**: What gateway are you using? I don’t see ``cart.gateway.getPaymentFormHtml()`` in your code at all?  
> **username_0**: Sorry, I have now added it in the response  

---

## 0 answers

