Module: Vindi::Rest::PaymentProfile

Included in:
Vindi::Rest
Defined in:
lib/vindi/rest/payment_profile.rb

Overview

Methods for the Payment profile API

Instance Method Summary collapse

Instance Method Details

#create_payment_profile(options = {}) ⇒ Hash

Create a payment_profile for a merchant vindi

Examples:

Create a payment_profile for a merchant vindi

client.create_payment_profile(holder_name: "Jane Doe", card_cvv: "123",
                              card_expiration: "12/2018", customer_id: 51)
                              card_number: "5167454851671773",
                              payment_method_code: "credit_card",
                              payment_company_code: "mastercard",

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    payment_profile attributes

Returns:

  • (Hash)

    The payment_profile created

See Also:



37
38
39
# File 'lib/vindi/rest/payment_profile.rb', line 37

def create_payment_profile(options = {})
  post('payment_profiles', options)[:payment_profile]
end

#delete_payment_profile(payment_profile_id, options = {}) ⇒ Object

Delete a payment_profile from merchant vindi

Examples:

Delete payment_profile #2

client.delete_payment_profile(2)

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    payment_profile attributes

See Also:



49
50
51
# File 'lib/vindi/rest/payment_profile.rb', line 49

def delete_payment_profile(payment_profile_id, options = {})
  delete("payment_profiles/#{payment_profile_id}", options)[:payment_profile]
end

#list_payment_profiles(options = {}) ⇒ Array<Hash>

List payment_profile for the authenticate user

Examples:

Get all payment_profiles from merchant vindi

Returns:

  • (Array<Hash>)

    A list of payment_profiles for a merchant.



11
12
13
# File 'lib/vindi/rest/payment_profile.rb', line 11

def list_payment_profiles(options = {})
  get('payment_profiles', options)[:payment_profiles]
end

#payment_profile(payment_profile_id, options = {}) ⇒ Hash

Get a single payment_profile from a merchant

Examples:

Get payment_profile #2 from vindi

client.payment_profile(2)

Parameters:

  • payment_profile_id (Integer)

    ID of the payment_profile

Returns:

  • (Hash)

    The payment_profile you requested, if it exists

See Also:



22
23
24
# File 'lib/vindi/rest/payment_profile.rb', line 22

def payment_profile(payment_profile_id, options = {})
  get("payment_profiles/#{payment_profile_id}", options)[:payment_profile]
end