Module: AcceptOn::API::Tokenization

Includes:
Utils
Included in:
Client
Defined in:
lib/accepton/api/tokenization.rb

Instance Method Summary collapse

Instance Method Details

#create_token(args = {}) ⇒ AcceptOn::TransactionToken

Creates a transaction token on AcceptOn

create_token(amount: 15_00, description: 'Test', application_fee: 1_50, merchant_paypal_account: '[email protected]')

Examples:

Create a transaction token with an amount of $1.00

create_token(amount: 1_00)

Create a transaction token with a description

create_token(amount: 1_00, description: 'Test')

Create a transaction token with a description and application fee

create_token(amount: 10_99, description: 'Test', application_fee: 99)

Create a Paypal-specific token that pays a merchant and charges

them an application fee

Parameters:

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

    Attributes to set to the transaction token

Options Hash (args):

  • :amount (Integer)

    The amount in cents of the transaction

  • :application_fee (Integer)

    The application fee to be passed on to the processor

  • :currency (String)

    The currency to charge in (default: usd)

  • :description (String)

    A description of the transaction

  • :merchant_paypal_account (String)

    The merchant's Paypal account when you want to pay a merchant instead of yourself. Can be used with an application fee.

Returns:

Raises:



37
38
39
# File 'lib/accepton/api/tokenization.rb', line 37

def create_token(args = {})
  perform_post_with_object('/v1/tokens', args, AcceptOn::TransactionToken)
end