<p>A no one has come forward and told me it's a bad idea, I've ploughed on and done the following:</p>
<ol>
<li><p>Created my own Controller action in my plugin to bypass the payment side of things altogether. I didn't use Omnipay to create my Customer on Stripe in the end. I went with using Stripes own API directly as documented <a href="https://stripe.com/docs/api/php#create_customer" rel="nofollow noreferrer">here</a>.</p>
</li>
<li><p>To complete the Order (as-in convert a <code>Cart</code> into a full-blown <code>Order</code>, it was as simple as calling the following <code>Commerce</code> method:</p>
<p><code>craft()-&gt;commerce_orders-&gt;completeOrder($cart);</code></p>
</li>
</ol>

CC BY-SA 3.0
2017-10-02T19:29:20.720Z
Hi Steve, are you still using this method in production? Have you run into any issues or things you had to do differently since implementing the above?
Luke Pearce
CC BY-SA 3.0
2017-10-03T06:55:19.520Z
@LukePearce It's still in use as far as I'm aware, it's not an active project for me any more. I didn't run into any issues at the time, so what's above is still accurate, unless there's a newer better way.
Steve Holland
CC BY-SA 3.0
2016-06-16T11:24:45.430Z
2016-06-16T11:24:45.430Z
2020-06-17T08:56:27.903Z
Steve Holland
<p>Instead of taking payment via the <code>Omnipay/Stripe</code> Payment Method, what I'm trying to do is just create a new Customer and Credit Card on Stripe during Checkout, no payment taken at all at this stage.</p>

<p>Looking through the Stripe code it looks as though that functionality already exists. On the Stripe Gateway, this looks like it should do what I want. </p>

<pre><code>public function createCard(array $parameters = array())
{
    return $this-&gt;createRequest('\Omnipay\Stripe\Message\CreateCardRequest', $parameters);
}
</code></pre>

<p>What I'm struggling with is how/where to call this and finish up the Order by turning the Cart into an Order.</p>

<p>The Checkout / Payment page submits to the following Controller: </p>

<pre><code>Commerce_PaymentsController-&gt;actionPay()
</code></pre>

<p>I could just duplicate the functionality in here swapping out what I don't need, but this feels really hacky/wrong! </p>

<p>Has anyone any suggestions for a more sensible approach? </p>

<plugin-craftcommerce><omnipay-stripe><payment-methods>
Create an alternate Stripe Payment Method
# Create an alternate Stripe Payment Method

(Asked by: username_0 on 2016-06-14)

Instead of taking payment via the Omnipay/Stripe Payment Method, what I'm trying to do is just create a new Customer and Credit Card on Stripe during Checkout, no payment taken at all at this stage.
Looking through the Stripe code it looks as though that functionality already exists. On the Stripe Gateway, this looks like it should do what I want. 
public function createCard(array $parameters = array())
{
    return $this->createRequest('\Omnipay\Stripe\Message\CreateCardRequest', $parameters);
}

What I'm struggling with is how/where to call this and finish up the Order by turning the Cart into an Order.
The Checkout / Payment page submits to the following Controller: 
Commerce_PaymentsController->actionPay()

I could just duplicate the functionality in here swapping out what I don't need, but this feels really hacky/wrong! 
Has anyone any suggestions for a more sensible approach?

**Tags:** plugin-craftcommerce, omnipay-stripe, payment-methods


---

## 1 answers

### Answer by username_0 on 2016-06-16. Score: 1 | Accepted answer

A no one has come forward and told me it's a bad idea, I've ploughed on and done the following:

1. Created my own Controller action in my plugin to bypass the payment side of things altogether. I didn't use Omnipay to create my Customer on Stripe in the end. I went with using Stripes own API directly as documented [here](https://stripe.com/docs/api/php#create_customer).
2. To complete the Order (as-in convert a `Cart` into a full-blown `Order`, it was as simple as calling the following `Commerce` method:

   `craft()->commerce_orders->completeOrder($cart);`

> **Comments:**
> **username_1**: Hi Steve, are you still using this method in production? Have you run into any issues or things you had to do differently since implementing the above?  
> **username_0**: @LukePearce It's still in use as far as I'm aware, it's not an active project for me any more. I didn't run into any issues at the time, so what's above is still accurate, unless there's a newer better way.  

---

