0.0
No release in over a year
This library provides integration with Payoneer V4 API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.3.0, >= 2.3.0
~> 0.14.0
~> 10.0
~> 3.0

Runtime

~> 0.20, >= 0.20.0
 Project Readme

Installation

Add gem to your Gemfile and run bundle

gem 'payoneer-rb'

Usage

Configuration

All of the following properties have to be set in order for gem to work properly

# config/initializers/payoneer.rb

Payoneer.configure do |c|
  c.environment = # payoneer env (:sandbox (default) | :production)
  c.callback_url = # callback url used for sending auth codes (Optional)
  c.program_id = # program id
end

Examples

Create a signup url

> response = Payoneer::Payee.create_link(params: { payee_id: '<payee_id>' })
=> #<Payoneer::Response:0x0000000106404708 @body={"registration_link"=>"http://example.com"}>
> response.registration_link
=> "http://example.com"

Use { existing: true } if you want to generate a link for an existing user. Use { consent: true } if user needs to be redirected to consent flow after registration/login. Note: callback_url has to be specified for this feature to work.

Get the payee status

> response = Payoneer::Payee.status(payee_id: 1)
=> #<Payoneer::Response:0x000000010c58fc20 @body={"status"=>"Active"}>
> response.status
=> 'Active'

Get the payee details

> response = Payoneer::Payee.details(payee_id: 1)
=> #<Payoneer::Response:0x0000000111ce6640 @body={"account_id"=>"5510700", "type"=>"INDIVIDUAL", "contract"=>{"email"=>"demo008@yopmail.com"}, "address"=>{"city"=>"Berlin"}}>
> response.contact[:email]
=> "demo008@yopmail.com"
> response.address['city']
=> 'Berlin'

Release the payee

> response = Payoneer::Payee.release(payee_id: 1)
=> #<Payoneer::Response:0x00000001110e7060 @body={"payee_id"=>"12345"}>

Create a payout

> response = Payoneer::Payout.create(
  payment_id: '123abc',
  payee_id: '1',
  amount: 170.45,
  description: '',
  currency: 'USD'
)
=> #<Payoneer::Response:0x0000000106eb58a0 @body={"result"=>"Payments Created", "payment_id"=>"123abc"}>

Please keep in mind this an async process. Additional validation is being applied on Payoneer side. For payment status check use .status method described bellow.

Check the payout status

> response = Payoneer::Payout.status(payment_id: '123abc')
=> #<Payoneer::Payout::Status:0x000000011005dac8 @body={"status"=>"Pending", "payment_id"=>"123abc"}>
> response_failed = Payoneer::Payout.status(payment_id: 'abc123')
=> #<Payoneer::Payout::Status:0x0000000107a66a28 @body={"status"=>"Failed", "payment_id"=>"abc123", "error"=>{"description"=>"Server Error", "reason"=>nil}}>
> response_failed.error['description']
=> 'Server Error'

Check the program balance

> response = Payoneer::Program.balance
=> #<Payoneer::Response:0x0000000109d53b80 @body={"balance"=>50.0, "currency"=>"USD"}>