4

Developer of Charge here. This error is because you're passing an invalid currency code. You're passing aus as the planCurrency, but need to be passing aud for Australian Dollars. Under the hood, Charge is seeing that currency code as invalid, and unsetting the amount from the request, which is why that error is showing up on the planAmount. (Charge ...


4

I'm the developer of Charge. I've never directly observed that behaviour, but it sounds like it's most likely hitting a redirect failure and falling back to some base success/fail responses. The most likely cause of that, is that you've not specified the default success route in the Charge settings. You'll find that under Charge > Settings > General > ...


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

I got this resolved by official support. When using the combined date input you'll need to include the exp_month and exp_year inputs as hidden fields in the form. And here's the working hidden fields: <input type="hidden" name="cardExpMonth" value="" data-stripe="exp_month"> <input type="hidden" name="cardExpYear" value=""data-stripe="...


3

If CSRF protection is enabled (and it is by default for the latest versions of Craft), Stripe was getting a server error when using the Charge webhook url. The solution is to disable CSRF for the webhook URI - you can read more about it here or simply add this to your config/general.php file: 'enableCsrfProtection' => (!isset($_SERVER['REQUEST_URI']) || ...


3

Developer of Charge here. Yes - Charge supports all the native Craft criteria search parameters for fields. Like you mentioned, there are a few special fields that aren't supported currently within that. Those are fields like description, notes etc.. The supported direct attributes on the Charge model that can be searched (in addition to all the basic ...


3

So the answer at the bottom of the page here ended up solving my issue. The plugin was using php short array syntax " [ ] " which is available in 5.4 + and the server was set at 5.3.29. When I changed that it worked perfectly.


3

I'm the developer of Charge. You need to go about the form setup a slightly different way. By design there are 2 ways to define the value for a Charge, either Setting the planAmount variable in your twig template, and passing it to the setCheckoutOptions/setPaymentOptions method. Passing the allowDynamic : true setting to the setCheckoutOptions/...


3

Developer of Charge here. Setup for installs up to (and including) 2.0.x : The simplest setup would be to use the onBeforeCharge event. This fires at the very start of the charge request, after validation but before anything has actually happened. You'd use that to jump in, and create your user, entry, or anything else you might want to do. As part of ...


3

You'd listen to Charge's onCharge event just like you'd listen to any of Craft's own events, using a plugin. Your plugin's init() method, for example could do this: craft()->on('charge.onCharge', function(Event $event) { // ... }); There's a nifty Craft plugin scaffold generator to get you started here, too.


2

I have seen this before - yesterday in fact, with this plugin. But I was messing about trying to get it to report errors back to the calling template from a plugin I was writing. I still don't know what caused it, but there might be a clue in that :/ Currently I have an issue with it where the redirect to success url never actually completes. Just hangs ...


2

Developer of Charge here. While it's not a feature that's currently supported out the box with Charge, it is something that's on the FR list, and is something I'm looking at adding. If you drop me a line directly I can talk over some of the options with you.


2

Developer of Charge here. Yes - you absolutely can control the label generated for the checkout button. When setting the details for the checkout option, you just need to pass a sub-array called checkout, along with the extra parameters that get passed straight down the modal js. Specifically you'd want do some thing like this : {% set options = { ...


2

I'm the developer of Charge. The above issue is caused because you're passing in the title of the email, not the handle. We explicitly require the handle to be passed to ensure uniqueness. While the above patch would bypass the issue and let you define it by title, it's not ideal, and the proper fix is to the simply pass it by the handle in your templates. ...


2

I've actually answered the question in the question. Not sure why it's not showing as is, but the solution is updating the plugin file as mentioned above.


2

You want something like this: craft()->on('charge.onCharge', function($event) { $charge = $event->params['charge']; $pounds = $charge->amount; }


2

To listen to Craft Commerce order save event, you must make a new plugin (or use an existing one) and in it's ::init() method, listen to the commerce_orders.onSaveOrder event: class TestPlugin extends BasePlugin { public function init() { parent::init(); craft()->on( "commerce_orders.onSaveOrder", function ...


2

This is how I got the errors to show: {% if charge is defined and (charge.getErrors or charge.user) %} <div> {% if charge.getErrors %} {% for error in charge.getErrors('general') %} {{ error }} {% endfor %} {% for key, error in charge.getErrors %} {% if key != 'general' %} ...


2

Add the following hidden inputs below the <input type="text" data-stripe="exp" placeholder="mm / yy" id="cardExpiry"/> line: <input type="hidden" name="cardExpMonth" data-stripe="exp_month"> <input type="hidden" name="cardExpYear" data-stripe="exp_year"> The example in the documentation seems to be missing that information but you can ...


2

Eventually I just edited customerDetails.html and swapped out the select with a hidden field. Done. {{ forms.hidden({ name: 'createAccount', id: 'createAccount', value: 'yes' }) }}


2

I'm pretty sure this issue is caused because the model is being passed to the event without being populated first (it only has the EXACT details that are manually populated when the record is created, not the additional functions). I was able to use $chargeModel->planAmount just fine, and I was actually able to re-look up the model based on the passed ...


2

In your current example, you are not actually saving an entry. You are just setting up an onSaveEntry event listener. To save the entry you will need to actually save the entry using the [saveEntry][1] method. UPDATE: I'm not exactly sure what your setup is — but some variation on the following should work for you. In the CMS, add a field called 'invoiceID'...


2

Silly me, this has nothing to do with charge.js, one simply can't have a button with an id="submit" as weird things will happen - see this thread <input type="button" id="otherThanSubmit"> this works fine


2

Stripe changed up some API URLs, which threw off Charge's legacy method for detecting TLS compatibility. The erroneous warning is fixed in Charge 2.2.3.


1

You have to insert this below your textfields {% if charge is defined %} {% for error in charge.getErrors('FieldNameHere') %} <ul class="errors"><li>{{ error }}</li></ul> {% endfor %} {% endif %}


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

Can you not do: {% set total = 0 %} {% for charge in charges %} {% set total = total + charge.amount %} {% endfor %} {{ total|number_format(2, '.', ',') }} ?


1

You need to specify the HTTP method used by the $.ajax method. By default, it uses GET, but you need to submit the form using POST.


1

So, in order to achieve this I had to make a couple of small hacks to the module core, namely in Charge_ActionsService.php First, I added default case to triggerActionByType function: default : { $processor = explode("_", $type); $class = $processor[0]; $function = $processor[1]; craft()->$class->$function($details, $chargeModel); ...


1

I don't see events being triggered in the Actions Service (in my version of Charge anyway), so you won't be able to listen for those. You'll most likely have to modify the core, if you do, document that and when you update charge, you can easily put your modifications back into place or do a pull request to charge in hopes that event gets added to the core.


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