How can I use the Mass Pay API with the new REST API in Ruby?

113 Views Asked by At

We are currently using two gems in our project:

We use the Permissions SDK to get authorization from the users that use our application to make "Mass Pay API calls" on their behalf.

After we get the tokens from the permission call we initiate a merchant API instance and call the mass_pay method:

api = merchant_sdk_api(credentials[:token], credentials[:token_secret])
pay_req = api.build_mass_pay({ :ReceiverType => 'EmailAddress',
                                 :MassPayItem  => receivers_list_from(receivers, currency.upcase)
                               })
response = api.mass_pay(pay_req)

The issue I'm having right now is that on the "merchant-sdk-ruby" page on github there is a notice that the API is going to be deprecated and we should use the REST API.

  1. How can I use the REST API to make mass payments on behalf of other users? I am not able to find anything in the REST documentation about this. It has only the usage of login with PayPal and getting tokens for that.
  2. Does anyone have any example of this?
1

There are 1 best solutions below

0
On BEST ANSWER

The Payout APIs are the REST equivalent of the MassPay APIs. However, third party processing has not yet been built into the REST APIs. Therefore, until it is, you would need to use the Classic MassPay and Permissions Service combination. The general rule of thumb is - if it's available in REST, use REST. If not, then you can continue to use Classic until an equivalent feature is available in REST.