harsh4u
harsh4u

Reputation: 2600

Payment using credit card through balanced payment in rails step by step

I am new to use balanced payments.

After get credit card info what is first, second... all steps..

can any one give me step by step so i can do on that way.

Thanks in advance

Upvotes: 0

Views: 563

Answers (2)

harsh4u
harsh4u

Reputation: 2600

I solved using below code in test mode (in RUBY):

  1. Install gem "balanced"

  2. Assign API key

    Balanced.configure('API KEY')

  3. Accept user card info

    card = Balanced::Card.new( :card_number => "4111111111111111", :expiration_month => "12", :expiration_year => "2020" ).save

  4. Create buyer to debit fee

buyer = Balanced::Marketplace.my_marketplace.create_buyer(:card_uri => card.uri)

5 Debit from buyer account

`another_debit = buyer.debit(
        :amount => 1000,
        :appears_on_statement_as => "MARKETPLACE.COM"
    )`

7 Credit to Merchant account (You need to verify Bank account first from here)

merchant = Balanced::Account.find('/v1/marketplaces/TEST-MP6wn7oEW117Yn9gKXuQaTIO/bank_accounts/BANK ACC ID')
    merchant.credit('1000')

Hope work for any one and suggestion welcome.

Upvotes: 0

Remear
Remear

Reputation: 1937

The steps would depend on what type of application you're trying to develop.

The basis of the system is that you create a Customer for each of your users. balanced.js removes the need for you to be PCI compliant because the sensitive data is submitted directly to Balanced and never goes through your servers. You use balanced.js to tokenize credit cards and bank accounts and add them to specific Customer instances. Once you've got the cards and bank accounts added you can do things like debit customerBuyerA and credit customerSellerB.

Next, I encourage you to read through some of the common fee scenarios to get an idea of what's going to work well for your business. https://docs.balancedpayments.com/current/#collecting-your-fees

Both https://docs.balancedpayments.com/current/overview.html and https://docs.balancedpayments.com/current/api.html have plenty of information to get you going from there.

I encourage you to stop by #balanced on IRC to get any other development questions answered.

Upvotes: 3

Related Questions