tanga_activemerchant 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1202 -0
- data/CONTRIBUTORS +414 -0
- data/MIT-LICENSE +20 -0
- data/README.md +221 -0
- data/gem-public_cert.pem +20 -0
- data/lib/active_merchant/billing/avs_result.rb +98 -0
- data/lib/active_merchant/billing/base.rb +57 -0
- data/lib/active_merchant/billing/check.rb +69 -0
- data/lib/active_merchant/billing/credit_card.rb +283 -0
- data/lib/active_merchant/billing/credit_card_formatting.rb +21 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +143 -0
- data/lib/active_merchant/billing/cvv_result.rb +38 -0
- data/lib/active_merchant/billing/expiry_date.rb +34 -0
- data/lib/active_merchant/billing/gateway.rb +181 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +725 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +956 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +468 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +105 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +314 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +15 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +393 -0
- data/lib/active_merchant/billing/gateways/beanstream.rb +169 -0
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
- data/lib/active_merchant/billing/gateways/blue_pay.rb +501 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +142 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +401 -0
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +225 -0
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
- data/lib/active_merchant/billing/gateways/certo_direct.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +639 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +591 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +230 -0
- data/lib/active_merchant/billing/gateways/elavon.rb +312 -0
- data/lib/active_merchant/billing/gateways/epay.rb +275 -0
- data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
- data/lib/active_merchant/billing/gateways/eway.rb +225 -0
- data/lib/active_merchant/billing/gateways/eway_managed.rb +291 -0
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +320 -0
- data/lib/active_merchant/billing/gateways/exact.rb +218 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +173 -0
- data/lib/active_merchant/billing/gateways/federated_canada.rb +167 -0
- data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +176 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +257 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +207 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +35 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +249 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +66 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
- data/lib/active_merchant/billing/gateways/instapay.rb +163 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +262 -0
- data/lib/active_merchant/billing/gateways/itransact.rb +448 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +275 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +447 -0
- data/lib/active_merchant/billing/gateways/litle.rb +554 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +176 -0
- data/lib/active_merchant/billing/gateways/merchant_one.rb +115 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +322 -0
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +275 -0
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +191 -0
- data/lib/active_merchant/billing/gateways/mercury.rb +311 -0
- data/lib/active_merchant/billing/gateways/metrics_global.rb +322 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
- data/lib/active_merchant/billing/gateways/migs.rb +265 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +37 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +219 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +244 -0
- data/lib/active_merchant/billing/gateways/moneris_us.rb +208 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +277 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +193 -0
- data/lib/active_merchant/billing/gateways/netaxept.rb +181 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +197 -0
- data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +20 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +421 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +297 -0
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +93 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
- data/lib/active_merchant/billing/gateways/orbital.rb +633 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +261 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +396 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +119 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +196 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +209 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +39 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
- data/lib/active_merchant/billing/gateways/payflow.rb +268 -0
- data/lib/active_merchant/billing/gateways/payflow_express.rb +224 -0
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +15 -0
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +21 -0
- data/lib/active_merchant/billing/gateways/payment_express.rb +353 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +670 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +61 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +248 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +106 -0
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +239 -0
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +199 -0
- data/lib/active_merchant/billing/gateways/payway.rb +207 -0
- data/lib/active_merchant/billing/gateways/pin.rb +165 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +294 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +227 -0
- data/lib/active_merchant/billing/gateways/psl_card.rb +303 -0
- data/lib/active_merchant/billing/gateways/qbms.rb +292 -0
- data/lib/active_merchant/billing/gateways/quantum.rb +276 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +335 -0
- data/lib/active_merchant/billing/gateways/realex.rb +303 -0
- data/lib/active_merchant/billing/gateways/redsys.rb +394 -0
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +93 -0
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +114 -0
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +102 -0
- data/lib/active_merchant/billing/gateways/sage.rb +152 -0
- data/lib/active_merchant/billing/gateways/sage_pay.rb +324 -0
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +143 -0
- data/lib/active_merchant/billing/gateways/samurai.rb +118 -0
- data/lib/active_merchant/billing/gateways/secure_net.rb +261 -0
- data/lib/active_merchant/billing/gateways/secure_pay.rb +28 -0
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +279 -0
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +112 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +453 -0
- data/lib/active_merchant/billing/gateways/smart_ps.rb +272 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
- data/lib/active_merchant/billing/gateways/stripe.rb +316 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +126 -0
- data/lib/active_merchant/billing/gateways/transax.rb +23 -0
- data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +421 -0
- data/lib/active_merchant/billing/gateways/usa_epay.rb +25 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1501 -0
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +201 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +232 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +189 -0
- data/lib/active_merchant/billing/gateways/vindicia.rb +361 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +57 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +313 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +303 -0
- data/lib/active_merchant/billing/gateways.rb +17 -0
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +31 -0
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +186 -0
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +38 -0
- data/lib/active_merchant/billing/integrations/a1agregator.rb +26 -0
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +73 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +229 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +340 -0
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +38 -0
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
- data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/bogus.rb +23 -0
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +120 -0
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +158 -0
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/chronopay.rb +23 -0
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
- data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
- data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
- data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +23 -0
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +43 -0
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +64 -0
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +49 -0
- data/lib/active_merchant/billing/integrations/dwolla.rb +23 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +34 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +84 -0
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +48 -0
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +40 -0
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +36 -0
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/easy_pay.rb +30 -0
- data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
- data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
- data/lib/active_merchant/billing/integrations/epay.rb +21 -0
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +61 -0
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
- data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +70 -0
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +85 -0
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/gestpay.rb +25 -0
- data/lib/active_merchant/billing/integrations/helper.rb +117 -0
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
- data/lib/active_merchant/billing/integrations/hi_trust.rb +27 -0
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +114 -0
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +95 -0
- data/lib/active_merchant/billing/integrations/ipay88.rb +19 -0
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +43 -0
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +89 -0
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +83 -0
- data/lib/active_merchant/billing/integrations/liqpay.rb +30 -0
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
- data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +75 -0
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
- data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +94 -0
- data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/nochex.rb +88 -0
- data/lib/active_merchant/billing/integrations/notification.rb +71 -0
- data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
- data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +42 -0
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +50 -0
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +134 -0
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/pay_fast.rb +70 -0
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +116 -0
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
- data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +119 -0
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +227 -0
- data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/paypal.rb +39 -0
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +15 -0
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +20 -0
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +15 -0
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +28 -0
- data/lib/active_merchant/billing/integrations/paysbuy.rb +36 -0
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +165 -0
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +36 -0
- data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
- data/lib/active_merchant/billing/integrations/platron/helper.rb +32 -0
- data/lib/active_merchant/billing/integrations/platron/notification.rb +113 -0
- data/lib/active_merchant/billing/integrations/platron.rb +28 -0
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +112 -0
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
- data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +74 -0
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +137 -0
- data/lib/active_merchant/billing/integrations/quickpay.rb +21 -0
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
- data/lib/active_merchant/billing/integrations/return.rb +42 -0
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
- data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +136 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +91 -0
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +139 -0
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
- data/lib/active_merchant/billing/integrations/two_checkout.rb +44 -0
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +97 -0
- data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
- data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +88 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
- data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +17 -0
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +40 -0
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +47 -0
- data/lib/active_merchant/billing/integrations/webmoney.rb +43 -0
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +101 -0
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
- data/lib/active_merchant/billing/integrations/world_pay.rb +34 -0
- data/lib/active_merchant/billing/integrations.rb +17 -0
- data/lib/active_merchant/billing/response.rb +77 -0
- data/lib/active_merchant/billing.rb +9 -0
- data/lib/active_merchant/version.rb +3 -0
- data/lib/active_merchant.rb +63 -0
- data/lib/activemerchant.rb +1 -0
- data/lib/support/gateway_support.rb +65 -0
- data/lib/support/outbound_hosts.rb +25 -0
- data/lib/support/ssl_verify.rb +93 -0
- metadata +506 -0
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class FatZebraGateway < Gateway
|
6
|
+
self.live_url = "https://gateway.fatzebra.com.au/v1.0"
|
7
|
+
self.test_url = "https://gateway.sandbox.fatzebra.com.au/v1.0"
|
8
|
+
|
9
|
+
self.supported_countries = ['AU']
|
10
|
+
self.default_currency = 'AUD'
|
11
|
+
self.money_format = :cents
|
12
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
|
13
|
+
|
14
|
+
self.homepage_url = 'https://www.fatzebra.com.au/'
|
15
|
+
self.display_name = 'Fat Zebra'
|
16
|
+
|
17
|
+
# Setup a new instance of the gateway.
|
18
|
+
#
|
19
|
+
# The options hash should include :username and :token
|
20
|
+
# You can find your username and token at https://dashboard.fatzebra.com.au
|
21
|
+
# Under the Your Account section
|
22
|
+
def initialize(options = {})
|
23
|
+
requires!(options, :username, :token)
|
24
|
+
@username = options[:username]
|
25
|
+
@token = options[:token]
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
29
|
+
# To create a purchase on a credit card use:
|
30
|
+
#
|
31
|
+
# purchase(money, creditcard)
|
32
|
+
#
|
33
|
+
# To charge a tokenized card
|
34
|
+
#
|
35
|
+
# purchase(money, "abzy87u", :cvv => "123")
|
36
|
+
def purchase(money, creditcard, options = {})
|
37
|
+
post = {}
|
38
|
+
|
39
|
+
add_amount(post, money, options)
|
40
|
+
add_creditcard(post, creditcard, options)
|
41
|
+
post[:reference] = options[:order_id]
|
42
|
+
post[:customer_ip] = options[:ip]
|
43
|
+
|
44
|
+
commit(:post, 'purchases', post)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Refund a transaction
|
48
|
+
#
|
49
|
+
# amount - Integer - the amount to refund
|
50
|
+
# txn_id - String - the original transaction to be refunded
|
51
|
+
# reference - String - your transaction reference
|
52
|
+
def refund(money, txn_id, reference)
|
53
|
+
post = {}
|
54
|
+
|
55
|
+
post[:amount] = money
|
56
|
+
post[:transaction_id] = txn_id
|
57
|
+
post[:reference] = reference
|
58
|
+
|
59
|
+
commit(:post, "refunds", post)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Tokenize a credit card
|
63
|
+
#
|
64
|
+
# The token is returned in the Response#authorization
|
65
|
+
def store(creditcard)
|
66
|
+
post = {}
|
67
|
+
add_creditcard(post, creditcard)
|
68
|
+
|
69
|
+
commit(:post, "credit_cards", post)
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
# Add the money details to the request
|
75
|
+
def add_amount(post, money, options)
|
76
|
+
post[:amount] = money
|
77
|
+
end
|
78
|
+
|
79
|
+
# Add the credit card details to the request
|
80
|
+
def add_creditcard(post, creditcard, options = {})
|
81
|
+
if creditcard.respond_to?(:number)
|
82
|
+
post[:card_number] = creditcard.number
|
83
|
+
post[:card_expiry] = "#{creditcard.month}/#{creditcard.year}"
|
84
|
+
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
|
85
|
+
post[:card_holder] = creditcard.name if creditcard.name
|
86
|
+
elsif creditcard.is_a?(String)
|
87
|
+
post[:card_token] = creditcard
|
88
|
+
post[:cvv] = options[:cvv]
|
89
|
+
elsif creditcard.is_a?(Hash)
|
90
|
+
deprecated "Passing the credit card as a Hash is deprecated. Use a String and put the (optional) CVV in the options hash instead."
|
91
|
+
post[:card_token] = creditcard[:token]
|
92
|
+
post[:cvv] = creditcard[:cvv]
|
93
|
+
else
|
94
|
+
raise ArgumentError.new("Unknown credit card format #{creditcard.inspect}")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Post the data to the gateway
|
99
|
+
def commit(method, uri, parameters=nil)
|
100
|
+
response = begin
|
101
|
+
parse(ssl_request(method, get_url(uri), parameters.to_json, headers))
|
102
|
+
rescue ResponseError => e
|
103
|
+
return Response.new(false, "Invalid Login") if(e.response.code == "401")
|
104
|
+
parse(e.response.body)
|
105
|
+
end
|
106
|
+
|
107
|
+
success = success_from(response)
|
108
|
+
Response.new(
|
109
|
+
success,
|
110
|
+
message_from(response),
|
111
|
+
response,
|
112
|
+
:test => response["test"],
|
113
|
+
:authorization => authorization_from(response, success)
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
def success_from(response)
|
118
|
+
(
|
119
|
+
response["successful"] &&
|
120
|
+
response["response"] &&
|
121
|
+
(response["response"]["successful"] || response["response"]["token"])
|
122
|
+
)
|
123
|
+
end
|
124
|
+
|
125
|
+
def authorization_from(response, success)
|
126
|
+
if success
|
127
|
+
(response["response"]["id"] || response["response"]["token"])
|
128
|
+
else
|
129
|
+
nil
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def message_from(response)
|
134
|
+
if !response["errors"].empty?
|
135
|
+
response["errors"].join(", ")
|
136
|
+
elsif response["response"]["message"]
|
137
|
+
response["response"]["message"]
|
138
|
+
else
|
139
|
+
"Unknown Error"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Parse the returned JSON, if parse errors are raised then return a detailed error.
|
144
|
+
def parse(response)
|
145
|
+
begin
|
146
|
+
JSON.parse(response)
|
147
|
+
rescue JSON::ParserError
|
148
|
+
msg = 'Invalid JSON response received from Fat Zebra. Please contact support@fatzebra.com.au if you continue to receive this message.'
|
149
|
+
msg += " (The raw response returned by the API was #{response.inspect})"
|
150
|
+
{
|
151
|
+
"successful" => false,
|
152
|
+
"response" => {},
|
153
|
+
"errors" => [msg]
|
154
|
+
}
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# Build the URL based on the AM mode and the URI
|
159
|
+
def get_url(uri)
|
160
|
+
base = test? ? self.test_url : self.live_url
|
161
|
+
base + "/" + uri
|
162
|
+
end
|
163
|
+
|
164
|
+
# Builds the auth and U-A headers for the request
|
165
|
+
def headers
|
166
|
+
{
|
167
|
+
"Authorization" => "Basic " + Base64.strict_encode64(@username.to_s + ":" + @token.to_s).strip,
|
168
|
+
"User-Agent" => "Fat Zebra v1.0/ActiveMerchant #{ActiveMerchant::VERSION}"
|
169
|
+
}
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class FederatedCanadaGateway < Gateway
|
4
|
+
# Same URL for both test and live, testing is done by using the test username (demo) and password (password).
|
5
|
+
self.live_url = self.test_url = 'https://secure.federatedgateway.com/api/transact.php'
|
6
|
+
|
7
|
+
APPROVED, DECLINED, ERROR = 1, 2, 3
|
8
|
+
|
9
|
+
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
10
|
+
self.supported_countries = ['CA']
|
11
|
+
|
12
|
+
self.default_currency = 'CAD'
|
13
|
+
|
14
|
+
# The card types supported by the payment gateway
|
15
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
16
|
+
|
17
|
+
# The homepage URL of the gateway
|
18
|
+
self.homepage_url = 'http://www.federatedcanada.com/'
|
19
|
+
|
20
|
+
# The name of the gateway
|
21
|
+
self.display_name = 'Federated Canada'
|
22
|
+
|
23
|
+
def initialize(options = {})
|
24
|
+
requires!(options, :login, :password)
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def purchase(money, creditcard, options = {})
|
29
|
+
post = {}
|
30
|
+
add_invoice(post, options)
|
31
|
+
add_creditcard(post, creditcard)
|
32
|
+
add_address(post, options)
|
33
|
+
add_customer_data(post, options)
|
34
|
+
commit('sale', money, post)
|
35
|
+
end
|
36
|
+
|
37
|
+
def authorize(money, creditcard, options = {})
|
38
|
+
post = {}
|
39
|
+
add_invoice(post, options)
|
40
|
+
add_creditcard(post, creditcard)
|
41
|
+
add_address(post, options)
|
42
|
+
add_customer_data(post, options)
|
43
|
+
commit('auth', money, post)
|
44
|
+
end
|
45
|
+
|
46
|
+
def capture(money, authorization, options = {})
|
47
|
+
options[:transactionid] = authorization
|
48
|
+
commit('capture', money, options)
|
49
|
+
end
|
50
|
+
|
51
|
+
def void(authorization, options = {})
|
52
|
+
options[:transactionid] = authorization
|
53
|
+
commit('void', nil, options)
|
54
|
+
end
|
55
|
+
|
56
|
+
def refund(money, authorization, options = {})
|
57
|
+
commit('refund', money, options.merge(:transactionid => authorization))
|
58
|
+
end
|
59
|
+
|
60
|
+
def credit(money, authorization, options = {})
|
61
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
62
|
+
refund(money, authorization, options)
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def add_customer_data(post, options)
|
68
|
+
post[:firstname] = options[:first_name]
|
69
|
+
post[:lastname] = options[:last_name]
|
70
|
+
|
71
|
+
post[:email] = options[:email]
|
72
|
+
end
|
73
|
+
|
74
|
+
def add_address(post, options)
|
75
|
+
if address = (options[:billing_address] || options[:address])
|
76
|
+
post[:company] = address[:company]
|
77
|
+
post[:address1] = address[:address1]
|
78
|
+
post[:address2] = address[:address2]
|
79
|
+
post[:city] = address[:city]
|
80
|
+
post[:state] = address[:state]
|
81
|
+
post[:zip] = address[:zip]
|
82
|
+
post[:country] = address[:country]
|
83
|
+
post[:phone] = address[:phone]
|
84
|
+
end
|
85
|
+
if address = options[:shipping_address]
|
86
|
+
post[:shipping_firstname] = address[:first_name]
|
87
|
+
post[:shipping_lastname] = address[:last_name]
|
88
|
+
post[:shipping_company] = address[:company]
|
89
|
+
post[:shipping_address1] = address[:address1]
|
90
|
+
post[:shipping_address2] = address[:address2]
|
91
|
+
post[:shipping_city] = address[:city]
|
92
|
+
post[:shipping_state] = address[:state]
|
93
|
+
post[:shipping_zip] = address[:zip]
|
94
|
+
post[:shipping_country] = address[:country]
|
95
|
+
post[:shipping_email] = address[:email]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def add_invoice(post, options)
|
100
|
+
post[:orderid] = options[:order_id]
|
101
|
+
post[:orderdescription] = options[:description]
|
102
|
+
end
|
103
|
+
|
104
|
+
def add_creditcard(post, creditcard)
|
105
|
+
post[:ccnumber] = creditcard.number
|
106
|
+
post[:ccexp] = expdate(creditcard)
|
107
|
+
post[:cvv] = creditcard.verification_value
|
108
|
+
end
|
109
|
+
|
110
|
+
def expdate(creditcard)
|
111
|
+
year = sprintf("%.4i", creditcard.year)
|
112
|
+
month = sprintf("%.2i", creditcard.month)
|
113
|
+
"#{month}#{year[-2..-1]}"
|
114
|
+
end
|
115
|
+
|
116
|
+
def parse(body)
|
117
|
+
body.split('&').inject({}) do |memo, x|
|
118
|
+
k, v = x.split('=')
|
119
|
+
memo[k] = v
|
120
|
+
memo
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def commit(action, money, parameters)
|
125
|
+
parameters[:amount] = amount(money)
|
126
|
+
data = ssl_post(self.live_url, post_data(action, parameters))
|
127
|
+
response = parse(data)
|
128
|
+
message = message_from(response)
|
129
|
+
test_mode = test?
|
130
|
+
|
131
|
+
Response.new(success?(response), message, response,
|
132
|
+
:test => test?,
|
133
|
+
:authorization => response['transactionid'],
|
134
|
+
:avs_result => {:code => response['avsresponse']},
|
135
|
+
:cvv_result => response['cvvresponse']
|
136
|
+
)
|
137
|
+
end
|
138
|
+
|
139
|
+
def success?(response)
|
140
|
+
response['response'] == '1'
|
141
|
+
end
|
142
|
+
|
143
|
+
def test?
|
144
|
+
(@options[:login].eql?('demo')) && (@options[:password].eql?('password'))
|
145
|
+
end
|
146
|
+
|
147
|
+
def message_from(response)
|
148
|
+
case response['response'].to_i
|
149
|
+
when APPROVED
|
150
|
+
"Transaction Approved"
|
151
|
+
when DECLINED
|
152
|
+
"Transaction Declined"
|
153
|
+
else
|
154
|
+
"Error in transaction data or system error"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def post_data(action, parameters = {})
|
159
|
+
parameters[:type] = action
|
160
|
+
parameters[:username] = @options[:login]
|
161
|
+
parameters[:password] = @options[:password]
|
162
|
+
parameters.map{|k, v| "#{k}=#{CGI.escape(v.to_s)}"}.join('&')
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/cc5'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
class FinansbankGateway < CC5Gateway
|
6
|
+
self.live_url = self.test_url = 'https://www.fbwebpos.com/servlet/cc5ApiServer'
|
7
|
+
|
8
|
+
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
9
|
+
self.supported_countries = ['US', 'TR']
|
10
|
+
|
11
|
+
# The card types supported by the payment gateway
|
12
|
+
self.supported_cardtypes = [:visa, :master]
|
13
|
+
|
14
|
+
# The homepage URL of the gateway
|
15
|
+
self.homepage_url = 'https://www.fbwebpos.com/'
|
16
|
+
|
17
|
+
# The name of the gateway
|
18
|
+
self.display_name = 'Finansbank WebPOS'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,176 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class FirstPayGateway < Gateway
|
4
|
+
class FirstPayPostData < PostData
|
5
|
+
# Fields that will be sent even if they are blank
|
6
|
+
self.required_fields = [ :action, :amount, :trackid ]
|
7
|
+
end
|
8
|
+
|
9
|
+
# both URLs are IP restricted
|
10
|
+
self.test_url = 'https://apgcert.first-pay.com/AcqENGIN/SecureCapture'
|
11
|
+
self.live_url = 'https://acqengin.first-pay.com/AcqENGIN/SecureCapture'
|
12
|
+
|
13
|
+
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
14
|
+
self.supported_countries = ['US']
|
15
|
+
|
16
|
+
# The card types supported by the payment gateway
|
17
|
+
self.supported_cardtypes = [:visa, :master]
|
18
|
+
|
19
|
+
# The homepage URL of the gateway
|
20
|
+
self.homepage_url = 'http://www.first-pay.com'
|
21
|
+
|
22
|
+
# The name of the gateway
|
23
|
+
self.display_name = 'First Pay'
|
24
|
+
|
25
|
+
# all transactions are in cents
|
26
|
+
self.money_format = :cents
|
27
|
+
|
28
|
+
ACTIONS = {
|
29
|
+
'sale' => 1,
|
30
|
+
'credit' => 2,
|
31
|
+
'void' => 3
|
32
|
+
}
|
33
|
+
|
34
|
+
def initialize(options = {})
|
35
|
+
requires!(options, :login, :password)
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
def purchase(money, creditcard, options = {})
|
40
|
+
post = FirstPayPostData.new
|
41
|
+
add_invoice(post, options)
|
42
|
+
add_creditcard(post, creditcard)
|
43
|
+
add_address(post, options)
|
44
|
+
add_customer_data(post, options)
|
45
|
+
|
46
|
+
commit('sale', money, post)
|
47
|
+
end
|
48
|
+
|
49
|
+
def refund(money, reference, options = {})
|
50
|
+
requires!(options, :credit_card)
|
51
|
+
|
52
|
+
post = FirstPayPostData.new
|
53
|
+
add_invoice(post, options)
|
54
|
+
add_creditcard(post, options[:credit_card])
|
55
|
+
add_address(post, options)
|
56
|
+
add_customer_data(post, options)
|
57
|
+
add_credit_data(post, reference)
|
58
|
+
|
59
|
+
commit('credit', money, post)
|
60
|
+
end
|
61
|
+
|
62
|
+
def credit(money, reference, options = {})
|
63
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
64
|
+
refund(money, reference, options)
|
65
|
+
end
|
66
|
+
|
67
|
+
def void(money, creditcard, options = {})
|
68
|
+
post = FirstPayPostData.new
|
69
|
+
add_creditcard(post, creditcard)
|
70
|
+
add_void_data(post, options)
|
71
|
+
add_invoice(post, options)
|
72
|
+
add_customer_data(post, options)
|
73
|
+
|
74
|
+
commit('void', money, post)
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def add_customer_data(post, options)
|
81
|
+
post[:cardip] = options[:ip]
|
82
|
+
post[:email] = options[:email]
|
83
|
+
end
|
84
|
+
|
85
|
+
def add_address(post, options)
|
86
|
+
if billing_address = options[:billing_address] || options[:address]
|
87
|
+
post[:addr] = billing_address[:address1].to_s + ' ' + billing_address[:address2].to_s
|
88
|
+
post[:city] = billing_address[:city]
|
89
|
+
post[:state] = billing_address[:state]
|
90
|
+
post[:zip] = billing_address[:zip]
|
91
|
+
post[:country] = billing_address[:country]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def add_invoice(post, options)
|
96
|
+
post[:trackid] = rand(Time.now.to_i)
|
97
|
+
end
|
98
|
+
|
99
|
+
def add_creditcard(post, creditcard)
|
100
|
+
post[:member] = creditcard.first_name.to_s + " " + creditcard.last_name.to_s
|
101
|
+
post[:card] = creditcard.number
|
102
|
+
post[:exp] = expdate(creditcard)
|
103
|
+
end
|
104
|
+
|
105
|
+
def expdate(credit_card)
|
106
|
+
year = sprintf("%.4i", credit_card.year)
|
107
|
+
month = sprintf("%.2i", credit_card.month)
|
108
|
+
|
109
|
+
"#{month}#{year[-2..-1]}"
|
110
|
+
end
|
111
|
+
|
112
|
+
def add_credit_data(post, transaction_id)
|
113
|
+
post[:transid] = transaction_id
|
114
|
+
end
|
115
|
+
|
116
|
+
def add_void_data(post, options)
|
117
|
+
post[:transid] = options[:transactionid]
|
118
|
+
end
|
119
|
+
|
120
|
+
def commit(action, money, post)
|
121
|
+
response = parse( ssl_post(test? ? self.test_url : self.live_url, post_data(action, post, money)) )
|
122
|
+
|
123
|
+
Response.new(response[:response] == 'CAPTURED', response[:message], response,
|
124
|
+
:test => test?,
|
125
|
+
:authorization => response[:authorization],
|
126
|
+
:avs_result => { :code => response[:avsresponse] },
|
127
|
+
:cvv_result => response[:cvvresponse])
|
128
|
+
end
|
129
|
+
|
130
|
+
def parse(body)
|
131
|
+
response = {}
|
132
|
+
|
133
|
+
# check for an error first
|
134
|
+
if body.include?('!ERROR!')
|
135
|
+
response[:response] = 'ERROR'
|
136
|
+
response[:message] = error_message_from(body)
|
137
|
+
else
|
138
|
+
# a capture / not captured response will be : delimited
|
139
|
+
split = body.split(':')
|
140
|
+
response[:response] = split[0]
|
141
|
+
|
142
|
+
# FirstPay docs are worthless. turns out the transactionid is required for credits
|
143
|
+
# so we need to store that in authorization, not the actual auth.
|
144
|
+
if response[:response] == 'CAPTURED'
|
145
|
+
response[:message] = 'CAPTURED'
|
146
|
+
response[:authorization] = split[9] # actually the transactionid
|
147
|
+
response[:auth] = split[1]
|
148
|
+
response[:avsresponse] = split[3]
|
149
|
+
response[:cvvresponse] = split[17]
|
150
|
+
else
|
151
|
+
# NOT CAPTURED response
|
152
|
+
response[:message] = split[1]
|
153
|
+
response[:transactionid] = split[9]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
return response
|
158
|
+
end
|
159
|
+
|
160
|
+
def error_message_from(response)
|
161
|
+
# error messages use this format - '!ERROR! 704-MISSING BASIC DATA TYPE:card, exp, zip, addr, member, amount\n'
|
162
|
+
response.split("! ")[1].chomp
|
163
|
+
end
|
164
|
+
|
165
|
+
def post_data(action, post, money)
|
166
|
+
post[:vid] = @options[:login]
|
167
|
+
post[:password] = @options[:password]
|
168
|
+
post[:action] = ACTIONS[action]
|
169
|
+
post[:amount] = amount(money)
|
170
|
+
|
171
|
+
return post.to_post_data
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|