Hot answers tagged

5

As usual it is just me being stupid. The error is accessible with: {% set error = craft.session.getFlash('error') %} {{ error }} Maybe it will help some other people.


4

Just recently worked a similar project so I'll share what we've uncovered. Your needs are basically 2-fold: take payment and provide a platform where people can log into and consume content. Is this possible with CraftCMS or would it need Commerce? Craft has you covered on content, however taking payment is where having Commerce built-in can be ...


4

The following code allows the customisation of the fields using Stripe Elements. This code will replace the payment form with gateway.getPaymentFormHtml({}). The thing to note here is this is provided unsupported as it is custom code and does not use the payment form template or javascript file that is in the Commerce Stripe plugin. This also means that it ...


4

In the end I worked out the card is related to a customer, not a subscription. I couldn't see any public endpoint to update a customer's card, so I added this method in charge/controllers/ChargeController.php (not ideal to update the plugin directly I know): public function actionUpdateCard() { $this->requirePostRequest(); $customer = craft()->...


3

Probably best to use Craft Commerce emails, then you can put whatever information you want into the emails to your accounts departments. Like: {{ order.billingAddress.fullName }} If the billing address information is not being sent to Stripe, you might need to modify your checkout.js or stripe.js payment screen implementation to ensure it sends the billing ...


3

The processing transaction status is used when a gateway returns from offsite correctly (the user has done everything they can to make payment on the order) but since we didn't get a definitive answer from the gateway that the card has been charged, we put the transaction into a 'processing' status. This status means we complete the order as there is ...


3

A subscription's planData is currently only stored as JSON. You can use that JSON in your template but you'll need to decode it first. Marion Newlevant’s Twig Perversion plugin adds a json_decode filter among other helpful capabilities to Twig. With that plugin installed, set planData to a variable with the json_decode filter applied to it then you can ...


2

OK so here's how to go about it. On checkout, you'll need at minimum a form with the following elements: <form method="post" id="card-info"> <input type="hidden" name="action" value="commerce/payments/pay"> <input type="hidden" name="paymentMethodId" value="[fill this via JS]"> <input type="hidden" name="orderEmail" value="[your ...


2

The getPaymentFormHtml() method will output a huge chunk of code, including Stripe's iframe and all its nested fields and functionality - you can't simply wrap that in a label element and expect it to work, as the click event of the label will not reach inside the iFrame. The default output of Commerce Stripe's getPaymentFormHtml leaves a lot to be desired, ...


2

You can use {{ subscription.subscriptionData.plan.amount }} to get the price of the plan the customer subscribed to. That returns in cents so you'll need to convert and format it. {{ (subscription.subscriptionData.plan.amount / 100) | currency('USD', stripZeros=true) }}


2

Have you tried having a look at the API Docs for Stripe? They have written about ideal integration: https://stripe.com/docs/sources/ideal If its in your budget you should probably also have a look at Craft commerce which has partial Mollie integration which should, in turn, facilitate the iDeal payments solution that you are looking for. Though they do ...


2

My money is on 3D Secure, a security protocol that requires card authentication before the card can be charged. https://stripe.com/docs/payments/3d-secure So those "Redirect" orders are probably customers that were redirected to the authentication page but did not complete it. Code seems to support this hypothesis: https://github.com/craftcms/...


1

Update: By using http instead of https in the redirect URL. Stripe is able to successfully redirect back to my website. It would be nice to avoid this workaround and understand why using https in the redirect URL results in the request being blocked.


1

Could you use one of the following events? \craft\commerce\stripe\services\Invoices::EVENT_BEFORE_SAVE_INVOICE \craft\commerce\stripe\services\Invoices::EVENT_SAVE_INVOICE Maybe looking in the invoice model invoiceData attribute (that is passed to the above event). If that won't suffice, we should expose a way for you to listen to any Stripe Webhook event ...


1

Craft are hoping to release this as an update to Commerce in the next month or so!


1

At first glance I cannot tell you why your plugin runs intermittently. But if your plugin is interacting with Charge, there are some log functions you can use that may be helpful. craft()->charge_log->email("yada yada"); craft()->charge_log->note("yada yada"); craft()->charge_log->error("yada yada");


1

Stripe Payments is available in the plugin store for Craft CMS 3. We just added support to iDEAL for one-time and recurring payments. Best,


1

I'm not exactly sure how this plugin works, but in general the best way to do this is to rely on Webhooks. You can listen for charge.succeeded events and send an email when those occur. If you're not a programmer, you can always use something like Zapier or IFTTT to do this too. :) Hope that helps!


1

As of Commerce 2.0.0-beta.7, partial capture is not yet supported. Look out for it in the next release.


1

After looking into the source code of the encrypt function, the craft.charge.setPaymentOptions() function calls mcrypt_module_get_algo_key_size and because my vagrant box (ubuntu 14.04) didn't have php5-mcrypt installed, it failed there. To fix it: run apt-get install php5-mcrypt && sudo php5enmod mcrypt.


1

Developer of Charge here. The full details on the setup for Connect are detailed here : https://squarebit.co.uk/software/craft/charge/usage/reference/connect-setup Setting up a Charge to use Connect takes 4 broad steps - Configuring your Stripe Account, and Charge settings - this involves putting your platform keys into Charge, and the callback url(s) ...


1

Couldn't get past the white page issue so I made a simple plugin which does the following: craft()->on('commerce_transactions.onSaveTransaction', function($event) { $transaction = $event->params["transaction"]; if ($transaction->status == "failed") { $message = $transaction->response["error"]["message"]; craft()->...


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