This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mollie-api-ruby (3.1.2) lib/mollie/client.rb:28:in `instance' | |
mollie-api-ruby (3.1.2) lib/mollie/client.rb:36:in `ensure in with_api_key' | |
mollie-api-ruby (3.1.2) lib/mollie/client.rb:37:in `with_api_key' | |
app/models/spree/gateway/mollie_payments.rb:19:in `available_payment_methods' | |
app/views/spree/checkout/payment/_molliepayments.html.erb:1:in `_c1a28389e1fabe876b095bd91e2beecc' | |
actionview (5.1.4) lib/action_view/template.rb:157:in `block in render' | |
activesupport (5.1.4) lib/active_support/notifications.rb:168:in `instrument' | |
actionview (5.1.4) lib/action_view/template.rb:352:in `instrument_render_template' | |
actionview (5.1.4) lib/action_view/template.rb:155:in `render' | |
deface (1.3.0) lib/deface/action_view_extensions.rb:41:in `render' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Payment::Processing.module_eval do | |
def process!(amount = nil) | |
amount ||= money.money.cents | |
started_processing! | |
response = payment_method.create_transaction( | |
amount, | |
source, | |
gateway_options | |
) | |
handle_response(response, :pend, :failure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spree | |
module CheckoutWithMollie | |
def update | |
if payment_params_valid? && paying_with_mollie? | |
if @order.update_from_params(params, permitted_checkout_attributes, request.headers.env) | |
payment = @order.payments.last | |
payment.process! | |
mollie_payment_url = payment.payment_source.payment_url | |
MollieLogger.debug("For order #{@order.number} redirect user to payment URL: #{mollie_payment_url}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Payment.class_eval do | |
delegate :transaction_id, to: :source | |
def build_source | |
return unless new_record? | |
if source_attributes.present? && source.blank? && payment_method.try(:payment_source_class) | |
self.source = payment_method.payment_source_class.new(source_attributes) | |
source.payment_method_id = payment_method.id | |
source.user_id = order.user_id if order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X "PUT" "/api/v1/checkouts/R597974478" \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-H 'X-Spree-Token: 0123456789' \ | |
-d $'{ | |
"order": { | |
"payments_attributes": [ | |
{ | |
"payment_method_id": "1" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* app/assets/javascripts/spree/backend/shipments.js */ | |
/* global shipments, variantStockTemplate, order_number */ | |
// Shipments AJAX API | |
$(document).ready(function () { | |
'use strict' | |
// handle variant selection, show stock level. | |
$('#add_variant_id').change(function () { | |
var variantId = $(this).val() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/Sites/typescript-api-node/examples/customers typescript* | |
❯ node list | |
{ Error: Request failed with status code 401 | |
at createError (/Users/vernon/Sites/typescript-api-node/node_modules/axios/lib/core/createError.js:16:15) | |
at settle (/Users/vernon/Sites/typescript-api-node/node_modules/axios/lib/core/settle.js:18:12) | |
at IncomingMessage.handleStreamEnd (/Users/vernon/Sites/typescript-api-node/node_modules/axios/lib/adapters/http.js:201:11) | |
at emitNone (events.js:111:20) | |
at IncomingMessage.emit (events.js:208:7) | |
at endReadableNT (_stream_readable.js:1064:12) | |
at _combinedTickCallback (internal/process/next_tick.js:138:11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const apiKey = "test_xxx"; | |
const mollie = require("@mollie/api-client")({ apiKey }); | |
const MANDATE_STATUS_VALID = "valid"; | |
const retrieveCustomerMandates = customerId => | |
mollie.customers_mandates.all({ customerId }); | |
const customerHasValidMandates = customerId => { | |
return new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"expo": { | |
"name": "xxx", | |
"slug": "xxx", | |
"privacy": "public", | |
"sdkVersion": "33.0.0", | |
"platforms": ["ios"], | |
"version": "1.0.0", | |
"orientation": "portrait", | |
"icon": "./assets/icon.png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
'{{repeat(50)}}', | |
{ | |
id: 'cus_{{objectId()}}', | |
name: '{{firstName()}} {{surname()}}', | |
company: '{{company()}}', | |
email: '{{email()}}', | |
picture: { | |
large: 'https://randomuser.me/api/portraits/{{gender()}}/{{index(1)}}.jpg', | |
medium: 'https://randomuser.me/api/portraits/med/{{gender()}}/{{index(1)}}.jpg', |