Jump to content

Shop does not accept invoice payments!


alexm
 Share

Recommended Posts

I have invoice payments disabled and I'm checking out using Stripe.

On checkout success I get the error: 

User Error Exception: Shop does not accept invoice payments! (in /site/modules/Padloper/includes/order/PadloperCheckout.php line 590)

Any thoughts please. Latest version of Padloper and PW version 3.0.203 as latest version causes issues with Padloper.

Thanks in advance

Link to comment
Share on other sites

Just to clarify. I'm using custom form fields. I've used both shipping and billing fields. I have only Stripe active. On the backend, I checked Invoice and PayPayl and set them to inactive.

That is all I've done. Other than that, the setup is the same as or follows extremely closely the github examples

Link to comment
Share on other sites

It's something to do with this check. If I enable invoice as a payment option there is no error. The issue is, I don't want invoice enabled really. But for now I'll just output only Stripe as a payment method rather than loop active payment methods.

// ---------------
		// CHECK IF THIS ORDER HAS BEEN PAID
		// we check the payment status
		// @NOTE: WE ONLY CHECK FOR NON INVOICE ORDERS!
		$orderPaymentStatus = $response->order->paymentStatus;
		if (empty($this->isInvoiceOrder())) {
			// NON-INVOICE PAYMENT CHECK
			// @TODO CHANGGE THIS!
			// if (empty($order->padloper_order->pad_paid)) {
			// @TODO AMEND AS PER NEW APPROACH OF CONFIRMING SUCCESS IN GETCOMPLETEDORDER -> CAN EVEN CHECK THERE!
			if ((int) $orderPaymentStatus !== self::PAYMENT_STATUS_PAID) {
				// ORDER NOT PAID FOR BUT NOT INVOICE ORDER!, THROW EXCEPTION
				throw new Wire404Exception($this->_("Invalid order"));
			}
		} else {
			// INVOICE PAYMENTS CHECK
			// check if shop accepts invoice payments!
			if (empty($this->isShopAcceptsInvoicePayments())) {
				throw new WireException($this->_("Shop does not accept invoice payments!"));
			}
		}

 

Link to comment
Share on other sites

I'll have a look. From what I can see, for some reason your payment is being considered an invoice payment. Since your shop doesn't accept invoice payments, the error is thrown. I need to find out why your Stripe payments are being 'classified' as invoice payments by the check.

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

Hey @alexm. Found the problem. The issue was that by the time we were checking the session whether this was an invoice order or not we had already cleared the session plus we were return the opposite of that, hence !null became true. This meant it was always returning that the order was an invoice order...etc.

I'll try and push tonight...I must warn you though, there is the little matter of a spherical leather object ...?. If you need this ASAP, I can email you the amended file.

  • Haha 1
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...