Sha256: 1f71192cd4b0113be0122565fa4a56a755974181b5b1ea2b7daab7ae737b433f

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

require_relative 'utils.rb'
require 'VoucherifySdk'

def create_customer(customers_api_instance)
    begin
        # Create Customer
        created_customer = customers_api_instance.create_customer({
            customers_create_request_body: VoucherifySdk::CustomersCreateRequestBody.new({
            source_id: generate_random_string(),
            name: "John Doe",
            address: VoucherifySdk::CustomerAddress.new({
                country: "US",
                city: "New York",
                line_1: "5th Avenue",
                line_2: "1/2",
                postal_code: "11-111"
            })
            })
        })
        return created_customer
    rescue VoucherifySdk::ApiError => e
        return nil
    end
end

def delete_customer_permanently(customers_api_instance, customer_id)
    begin
        # Delete Customer
        result = customers_api_instance.customer_permanently_deletion(customer_id)
        return result
    rescue VoucherifySdk::ApiError => e
        return nil
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voucherify-8.0.3 __tests__/lib/customers.rb
voucherify-8.0.2 __tests__/lib/customers.rb
voucherify-8.0.1 __tests__/lib/customers.rb
voucherify-8.0.0 __tests__/lib/customers.rb
voucherify-7.0.0 __tests__/lib/customers.rb
voucherify-6.0.0 __tests__/lib/customers.rb