Sha256: 469bc91508dec7d4d68e1f6a98340831e489393e5f3b13f9c13c7c01e77bf0d2
Contents?: true
Size: 869 Bytes
Versions: 29
Compression:
Stored size: 869 Bytes
Contents
# frozen_string_literal: true module SolidusNexio class CreditCardsController < BasePaymentController def create token = payment_method.store(credit_card_params) if token render json: { data: { token: token } }, status: 201 else head 422 end end private def credit_card_params params.require(:data).permit(:currency, :one_time_token, address: %i[address1 address2 city country phone zip state], billing_address: %i[address1 address2 city country phone zip state], card: ::Spree::PermittedAttributes.source_attributes, customer: %i[first_name last_name email], order: %i[number date]).to_h.deep_symbolize_keys end end end
Version data entries
29 entries across 29 versions & 1 rubygems