pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/arambert/Paybox-Direct-Plus

ithubassets.com/assets/primer-70be7debc79a8eff.css" /> GitHub - arambert/Paybox-Direct-Plus: Paybox Direct Plus ActiveMerchant Billing Gateway implementation · GitHub
Skip to content

arambert/Paybox-Direct-Plus

Repository files navigation

Paybox Direct Plus

This is a implementation of Paybox Direct Plus for ActiveMerchant. Paybox Direct Plus is a French payment solution allowing recurring payments, subscriptions, etc.

Setup the gateway

gateway = ActiveMerchant::Billing::PayboxDirectPlusGateway.new(
  login:    '199988899',
  password: '1999888I'
)

Subscribed user functionalities

Create a user profile:

response = gateway.subscriber_create(amount, active_merchant_credit_card, user_reference: 'YOUR_USER_REFERENCE')
response.success?           # check if called succeeded
response.authorization      # authorization number, to be used for capture / void / refund
response.params['porteur']  # credit card reference, to be saved to use with the user reference for future purchases

When creating a user profile, Paybox will do an authorization on the credit card. Paybox recommends that you give the same amount than your transaction so you can simple capture it later.

If you don't know yet how much you'll have to charge the client, you can also send an amount of 0.

After your client is subscribed, you will be able to use several other operations:

credit_card = ActiveMerchant::Billing::CreditCard.new(
  last_name:          client_cc.last_name,
  first_name:         client_cc.first_name,
  verification_value: client_cc.verification_value,
  year:               client_cc.expires_on.year,
  month:              client_cc.expires_on.month
) # notice the absence of credit card number here

purchase = gateway.subscriber_purchase(
  amount, credit_card,
  user_reference:  'YOUR_USER_REFERENCE',
  order_id:        'ORDER_REFERENCE',
  credit_card_reference: subscriber_create_response.params['porteur']
) # authorize + capture in one call

authorize = gateway.subscriber_authorize(
  amount, credit_card,
  user_reference:        'YOUR_USER_REFERENCE',
  order_id:              'ORDER_REFERENCE',
  credit_card_reference: subscriber_create_response.params['porteur']
)

capture = gateway.subscriber_capture(
  amount, authorize.authorization,
  user_reference: 'YOUR_USER_REFERENCE',
  order_id:       'ORDER_REFERENCE'
)

refund = gateway.subscriber_refund(
  amount, authorize.authorization,
  user_reference: 'YOUR_USER_REFERENCE',
  order_id:       'ORDER_REFERENCE'
)

void = gateway.subscriber_void(
  amount, authorize.authorization,
  user_reference: 'YOUR_USER_REFERENCE',
  order_id:       'ORDER_REFERENCE'
)

Using the subscriber_purchase method will do an authorization and a capture. Some banks requires some delay between 2 authorizations on the same card. So, if you register a profile then call subscriber_purchase just after instead of subscriber_capture, it may fail with some banks.

Non subscribed user functionalities

The gateway inherits Donal Piret's Paybox Direct Gateway, so all methods of that gateway are accessible.

Compatibility

For Ruby 1.8, use version 0.1.0

For Ruby 1.9, use version 0.2.0

For Ruby 2.0+, use latest version ~>1.0

Tests

Remote integrations tests using the Paybox tests logins and server are available and should always pass.

bundle install
bundle exec rake test

Credits

The base of all this work is Donald Piret's great work on Paybox Direct Gateway implementation.

Contact

Please don't hesitate to contact me if you have any question, any suggestion or if you found any bug.

About

Paybox Direct Plus ActiveMerchant Billing Gateway implementation

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy