Skip to main content
9 votes

How do I programmatically update the order status?

You want to use the State Machine methods of the Commerce Order class. It would be something like this, but it will depend on what you called your order states. $order_state = $orderObj->...
Chance G's user avatar
  • 2,601
4 votes

Do not request a billing address during checkout

It is quite hard to do indeed. One way to do this is by setting a dummy billing address and hide the address form. You will need to do the following: In a custom module, add a CommerceCheckoutPane ...
MegaChriz's user avatar
  • 800
3 votes

Do not request a billing address during checkout

TL:DR; Go to admin/config/people/profiles/types/manage/customer/form-display and disable the form elements you want to hide (config applies to entire site) Explanation It should be fairly easy to do ...
googletorp's user avatar
  • 35.4k
3 votes

How do I add extra cost with cash on delivery?

It's been a long time since this has been asked, but I'm adding my input here since I bumped into this while looking for the exact same thing for one of my projects. The way I found as the cleanest ...
Kostas's user avatar
  • 49
3 votes
Accepted

How to set up a recurring payment

It's entirely dependent on your business needs. The advantage of Commerce Recurring is that as part of the Drupal Commerce ecosystem, it gives you a complete toolset for building a subscription ...
Ryan Szrama's user avatar
  • 7,030
3 votes
Accepted

How to change payment state programmatically?

Clive method doesn't work, probably he wanted to write $payments = \Drupal::entityTypeManager()->getStorage('commerce_payment')->loadByProperties(['order_id' => $order->id()]); the ...
Blissful's user avatar
  • 691
3 votes
Accepted

Unable to enter credit card payment information

This is due to an API deprecation by Square that the module was not prepared for in advance. Please test the following patch and comment on the issue if it works for you. Thanks! https://www.drupal....
Ryan Szrama's user avatar
  • 7,030
2 votes
Accepted

Ensure registered users can publish nodes only after paying some money

The pre-existing solutions ( Commerce Node Checkout, UC Node Checkout, Pay-per-node) for this problem haven't been ported into D8. If one of the pre-existing solutions covers your use case well, ...
Shawn Conn's user avatar
  • 26.9k
2 votes

Can payment be done in pop-up rather than using redirect?

If your gateway tells you to redirect, you redirect. If you need a modal-based gateway, choose another gateway. Changing the flow recommended by your gateway puts you firmly in unsupported waters, ...
Bojan Zivanovic's user avatar
2 votes

How to change payment state programmatically?

Try this: use Drupal\commerce_payment\Entity\Payment; $payments = \Drupal::entityQuery('commerce_payment') ->condition('order_id', $order->id()) ->execute(); foreach ($payments as $...
Interdruper's user avatar
2 votes

How do I programmatically update the order status?

I think you are looking to "place" the order. You need to subscribe to the Event handler for this event: commerce_order.order.paid and with this handler code: public function ...
liquidcms's user avatar
  • 1,278
2 votes
Accepted

Commerce 2 how to set to live paypal signature API Credentials

Ok I sussed this out quicker than I expected. So for anyone else having this issue do this.. Login to the merchant account NOT the developer account. Menu on Top right Click Profile > Profile and ...
BigEd's user avatar
  • 649
2 votes
Accepted

How do I make a withdrawal?

I suppose this can be done, but it won't be easy. There will be quite some components and you will have to write some code. Disclaimer is that I have not tested anything of this code, but I hope this ...
Neograph734's user avatar
  • 8,429
2 votes
Accepted

How to update payment status inside an order?

Please change the code from \Drupal\commerce_order\Payment\Payment::loadByProperties(['order_id' => $order_id]); TO \Drupal::entityTypeManager() ->getStorage('...
Shreya Shetty's user avatar
2 votes
Accepted

What payment gateway should be used for invoice payment?

Yes - just create a new (custom, standard) payment method named Invoice, and user's then can select that. On the payment method edit form you can add more details, and even could limit the ...
rémy's user avatar
  • 5,720
1 vote
Accepted

What could be causing this error?

Commerce Stripe is a bit of a mess at the moment. There are lots of issues that need to be fixed as you can see in the project issue queue. You are probably experiencing the bug described on Stripe\...
Patrick Kenny's user avatar
1 vote

How do I integrate third-party payment gateways?

I don't think there's a module available for Drupal 8. Payment for Webform existed for Drupal 7 but it is no longer being developed. Instead, I would look at Drupal Commerce if you need a full-...
Patrick Kenny's user avatar
1 vote
Accepted

Recurring Framework crashes with Datarans

Module is simply not supporting recurring payment (yet). It is kinda prepared for it (stores alias returned from payment service), but main functionality of making API call is missing. I created ...
MilanG's user avatar
  • 539
1 vote

Ajax callback never called / triggered

You're never making it to your callback because you don't have your #ajax array defined correctly, callback should not be defined as a hashed key. Take a look at the Adding an AJAX event example on d....
sonfd's user avatar
  • 7,926
1 vote

Drupal Commerce Payment Module

Any module you distribute must be licensed under the GPL 2.0 or later. You are free to put it up for sale so long as anyone who buys it enjoys the same rights of redistribution - that's just the ...
Ryan Szrama's user avatar
  • 7,030
1 vote

How to create a custom payment page attached to a user account's form

First of all I advice you the two modules its very helpful and I used the before to achieve similar scenario as you asked. 1- commerce node checkout: allow you to charge users to create nodes. It ...
Mohammed Gomma's user avatar
1 vote

How do I deal with discounts/refunds and a payment gateway to achieve accurate reporting for accounting?

Step 1 - Enable Commerce RMA First of all, you need to get something in place to enable the tracking/registration of such refund requests within the Drupal Commerce ecosystem. For that, the Commerce ...
Pierre.Vriens's user avatar
1 vote
Accepted

Why there are two payment for one order with same remote ID

For some reason the IPN for that payment triggered the creation of a second payment transaction within Drupal Commerce. Couldn't tell you exactly why it happened, though it could've been the result ...
Ryan Szrama's user avatar
  • 7,030
1 vote
Accepted

where does $data come from in hook_tokens?

The $data is whatever is originally passed to the token_replace function by the process that's doing the token replacement. The var itself is: An array of keyed objects. For simple replacement ...
Clive's user avatar
  • 167k
1 vote
Accepted

Payment methods not showing

Drupal Commerce payment methods can usually be found at /admin/commerce/config/payment-methods. They are rules in fact. If for any reason that menu doesn't exist, check your rules. To get that ...
Kojo's user avatar
  • 3,513
1 vote

How to install patched Paypal module in Drupal Commerce?

You have to make sure that the temporary directory is configured at admin/config/media/file-system is writable. In my case /tmp is writable, as per the settings in the screenshot below.
AjitS's user avatar
  • 10.9k
1 vote

paypal no shipping address on file

try not passing that parameter at all Here is an excerpt from the PayPal's Express Checkout Integration guide about Shipping address: Suppressing the Buyer's Shipping Address You can suppress the ...
oksana-c's user avatar
  • 2,821
1 vote

How to set programmatically Line Item Price?

I have struggled a bit with this, as have others apparently, but i found the solution in another thread. Every time an order object is loaded the following function is fired: ...
Rasmus L. Knabe's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible