FedaPay provides an integrated Ruby library to interact with its API, especially useful for projects built with Ruby on Rails.

Installation

Add the following gem to your Gemfile

$ gem install fedapay-ruby

Use Case

example for creating a customer

require 'fedapay';
# configure FedaPay library
FedaPay.api_key = '' # Your secret api key
FedaPay.environment = '' # sandbox or live
phone = {
  country: 'bj',
  number: '66000001'
};
customer = FedaPay::Customer.create(
  firstname: 'firstname',
  lastname: 'lastname',
  email: 'email@test.com',
  phone_number: phone
);

example for Creating a Transaction

require 'fedapay'

FedaPay.api_key = 'YOUR_SECRET_API_KEY'
FedaPay.environment = 'sandbox'

transaction = FedaPay::Transaction.create(
  amount: 1000,
  currency: { iso: 'XOF' },
  customer: { id: 1 },
  description: 'Payment for order #1234',
  callback_url: 'https://example.com/callback',
  mode: 'mtn_open'
)

puts "Transaction successfully created : #{transaction.inspect}"

To integrate FedaPay with Ruby, refer to the resources below:

Official GitHub repository : fedapay-ruby

API Reference : api-reference

Demo app source code : ruby-sample

Live Demo : rubysample

These resources provide real-world use cases to help you smoothly integrate FedaPay into your Ruby projects.

FedaPay provides an integrated Ruby library to interact with its API, especially useful for projects built with Ruby on Rails.

Installation

Add the following gem to your Gemfile

$ gem install fedapay-ruby

Use Case

example for creating a customer

require 'fedapay';
# configure FedaPay library
FedaPay.api_key = '' # Your secret api key
FedaPay.environment = '' # sandbox or live
phone = {
  country: 'bj',
  number: '66000001'
};
customer = FedaPay::Customer.create(
  firstname: 'firstname',
  lastname: 'lastname',
  email: 'email@test.com',
  phone_number: phone
);

example for Creating a Transaction

require 'fedapay'

FedaPay.api_key = 'YOUR_SECRET_API_KEY'
FedaPay.environment = 'sandbox'

transaction = FedaPay::Transaction.create(
  amount: 1000,
  currency: { iso: 'XOF' },
  customer: { id: 1 },
  description: 'Payment for order #1234',
  callback_url: 'https://example.com/callback',
  mode: 'mtn_open'
)

puts "Transaction successfully created : #{transaction.inspect}"

To integrate FedaPay with Ruby, refer to the resources below:

Official GitHub repository : fedapay-ruby

API Reference : api-reference

Demo app source code : ruby-sample

Live Demo : rubysample

These resources provide real-world use cases to help you smoothly integrate FedaPay into your Ruby projects.