Sha256: d1a479f0abf1126a4f1c42f996b68fee49b9f0b272352ffeca4db73f7afae44b
Contents?: true
Size: 1.18 KB
Versions: 5
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module LedgerSync module Adaptors module Stripe module Customer module Operations class Create < Stripe::Operation::Create class Contract < LedgerSync::Adaptors::Contract params do required(:external_id).maybe(:string) required(:ledger_id).value(:nil) required(:email).maybe(:string) required(:name).filled(:string) required(:phone_number).maybe(:string) optional(:subsidiary).maybe(:hash, Types::Reference) end end private def operate stripe_customer = ::Stripe::Customer.create( email: resource.email, metadata: { external_id: resource.external_id }, name: resource.name, phone: resource.phone_number ) resource.ledger_id = stripe_customer.id success( resource: resource, response: stripe_customer ) end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems