
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Paypal::Masspay is a Ruby library that uses PayPals MassPay API to send Mass Payments.
The MassPay API provides a SOAP and NVP (Name-Value Pair) interface, however this library uses the NVP interface exclusively.
You can read more about PayPals MassPay API at the following link: PayPal MassPay API Documentationn
A introduction about PayPals NVP interface in general can be found here: PayPal NVP API Overview
In a nutshell the Paypal::Masspay library lets you send multiple payments at once using the following schema:
Paypal::Masspay::Configuration.configure do |config|
config.environment = :production
config.username = 'your_paypal_username'
config.password = 'your_paypal_password'
config.signature = 'your_paypal_signature'
end
masspay = Paypal::Masspay.new(:currency => 'USD') do |bucket|
bucket.add_recipient(Paypal::Masspay::Recipient.new(:recipient_email => 'chunky@example.com', :amount => 10.00, :unique_id => 1234, :note => 'hello'))
bucket.add_recipient(Paypal::Masspay::Recipient.new(:recipient_email => 'bacon@example.com', :amount => 2.95, :unique_id => 222))
end
masspay.deliver
It also supports being used like this:
Paypal::Masspay::Configuration.configure do |config|
config.environment = :production
config.username = 'your_paypal_username'
config.password = 'your_paypal_password'
config.signature = 'your_paypal_signature'
end
recipients = [
Paypal::Masspay::Recipient.new(
:recipient_email => 'chunky@example.com',
:amount => 10.00,
:unique_id => 1234,
:note => 'hello'),
Paypal::Masspay::Recipient.new(
:recipient_email => 'bacon@example.com',
:amount => 2.95,
:unique_id => 222)
]
masspay = Paypal::Masspay.new(:currency => 'USD', :recipients => recipients)
masspay.deliver
This sends a post request to the PayPal NVP API endpoint containing the following data:
USER=your_paypal_username&
PWD=your_paypal_password&
SIGNATURE=your_paypal_signature&
VERSION=2.3&
METHOD=MassPay&
RECEIVERTYPE=EmailAddress&
L_EMAIL0=chunky@example.com&
L_AMT0=10.00&
L_UNIQUEID0=1234&
L_NOTE0=hello&
L_EMAIL1=bacon@example.com&
L_AMT1=2.95&
L_UNIQUEID1=222&
CURRENCYCODE=USD
You are also able to check whether or not the request was successfully sent to paypal, and can check any returned error/warnings using the following code:
masspay.successful? # ===> true/false
masspay.errors # ===> [ <Paypal::Masspay::Error>, <Paypal::Masspay::Error>, ... ]
masspay.errors[0].methods # ===> [ :code, :short_message, :long_message, :severity ]
masspay.errors[0].code # ===> 10000
masspay.errors[0].short_message # ===> "insufficient funds"
FAQs
Unknown package
We found that paypal-masspay demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.