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,119 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class PaySecureGateway < Gateway
|
4
|
+
self.live_url = self.test_url = 'https://clearance.commsecure.com.au/cgi-bin/PSDirect'
|
5
|
+
|
6
|
+
self.money_format = :cents
|
7
|
+
|
8
|
+
# Currently Authorization and Capture is not implemented because
|
9
|
+
# capturing requires the original credit card information
|
10
|
+
TRANSACTIONS = {
|
11
|
+
:purchase => 'PURCHASE',
|
12
|
+
:authorization => 'AUTHORISE',
|
13
|
+
:capture => 'ADVICE',
|
14
|
+
:credit => 'REFUND'
|
15
|
+
}
|
16
|
+
|
17
|
+
SUCCESS = 'Accepted'
|
18
|
+
SUCCESS_MESSAGE = 'The transaction was approved'
|
19
|
+
|
20
|
+
self.supported_countries = ['AU']
|
21
|
+
self.homepage_url = 'http://www.commsecure.com.au/paysecure.shtml'
|
22
|
+
self.display_name = 'PaySecure'
|
23
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
24
|
+
|
25
|
+
def initialize(options = {})
|
26
|
+
requires!(options, :login, :password)
|
27
|
+
super
|
28
|
+
end
|
29
|
+
|
30
|
+
def purchase(money, credit_card, options = {})
|
31
|
+
requires!(options, :order_id)
|
32
|
+
|
33
|
+
post = {}
|
34
|
+
add_amount(post, money)
|
35
|
+
add_invoice(post, options)
|
36
|
+
add_credit_card(post, credit_card)
|
37
|
+
|
38
|
+
commit(:purchase, money, post)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
# Used for capturing, which is currently not supported.
|
43
|
+
def add_reference(post, identification)
|
44
|
+
auth, trans_id = identification.split(";")
|
45
|
+
post[:authnum] = auth
|
46
|
+
post[:transid] = trans_id
|
47
|
+
end
|
48
|
+
|
49
|
+
def add_amount(post, money)
|
50
|
+
post[:amount] = amount(money)
|
51
|
+
end
|
52
|
+
|
53
|
+
def add_invoice(post, options)
|
54
|
+
post[:merchant_transid] = options[:order_id].to_s.slice(0,21)
|
55
|
+
post[:memnum] = options[:invoice]
|
56
|
+
post[:custnum] = options[:customer]
|
57
|
+
post[:clientdata] = options[:description]
|
58
|
+
end
|
59
|
+
|
60
|
+
def add_credit_card(post, credit_card)
|
61
|
+
post[:cardnum] = credit_card.number
|
62
|
+
post[:cardname] = credit_card.name
|
63
|
+
post[:expiry] = expdate(credit_card)
|
64
|
+
post[:cvv2] = credit_card.verification_value
|
65
|
+
end
|
66
|
+
|
67
|
+
def expdate(credit_card)
|
68
|
+
year = sprintf("%.4i", credit_card.year)
|
69
|
+
month = sprintf("%.2i", credit_card.month)
|
70
|
+
|
71
|
+
"#{month}#{year[-2..-1]}"
|
72
|
+
end
|
73
|
+
|
74
|
+
def commit(action, money, parameters)
|
75
|
+
response = parse( ssl_post(self.live_url, post_data(action, parameters)) )
|
76
|
+
|
77
|
+
Response.new(successful?(response), message_from(response), response,
|
78
|
+
:test => test_response?(response),
|
79
|
+
:authorization => authorization_from(response)
|
80
|
+
)
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
def successful?(response)
|
85
|
+
response[:status] == SUCCESS
|
86
|
+
end
|
87
|
+
|
88
|
+
def authorization_from(response)
|
89
|
+
[ response[:authnum], response[:transid] ].compact.join(";")
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_response?(response)
|
93
|
+
!!(response[:transid] =~ /SimProxy/)
|
94
|
+
end
|
95
|
+
|
96
|
+
def message_from(response)
|
97
|
+
successful?(response) ? SUCCESS_MESSAGE : response[:errorstring]
|
98
|
+
end
|
99
|
+
|
100
|
+
def parse(body)
|
101
|
+
response = {}
|
102
|
+
body.to_s.each_line do |l|
|
103
|
+
key, value = l.split(":", 2)
|
104
|
+
response[key.to_s.downcase.to_sym] = value.strip
|
105
|
+
end
|
106
|
+
response
|
107
|
+
end
|
108
|
+
|
109
|
+
def post_data(action, parameters = {})
|
110
|
+
parameters[:request_type] = TRANSACTIONS[action]
|
111
|
+
parameters[:merchant_id] = @options[:login]
|
112
|
+
parameters[:password] = @options[:password]
|
113
|
+
|
114
|
+
parameters.reject{|k,v| v.blank?}.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join("&")
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
@@ -0,0 +1,196 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class PayboxDirectGateway < Gateway
|
4
|
+
class_attribute :live_url_backup
|
5
|
+
|
6
|
+
self.test_url = 'https://preprod-ppps.paybox.com/PPPS.php'
|
7
|
+
self.live_url = 'https://ppps.paybox.com/PPPS.php'
|
8
|
+
self.live_url_backup = 'https://ppps1.paybox.com/PPPS.php'
|
9
|
+
|
10
|
+
# Payment API Version
|
11
|
+
API_VERSION = '00103'
|
12
|
+
|
13
|
+
# Transactions hash
|
14
|
+
TRANSACTIONS = {
|
15
|
+
:authorization => '00001',
|
16
|
+
:capture => '00002',
|
17
|
+
:purchase => '00003',
|
18
|
+
:unreferenced_credit => '00004',
|
19
|
+
:void => '00005',
|
20
|
+
:refund => '00014'
|
21
|
+
}
|
22
|
+
|
23
|
+
CURRENCY_CODES = {
|
24
|
+
"AUD"=> '036',
|
25
|
+
"CAD"=> '124',
|
26
|
+
"CZK"=> '203',
|
27
|
+
"DKK"=> '208',
|
28
|
+
"HKD"=> '344',
|
29
|
+
"ICK"=> '352',
|
30
|
+
"JPY"=> '392',
|
31
|
+
"NOK"=> '578',
|
32
|
+
"SGD"=> '702',
|
33
|
+
"SEK"=> '752',
|
34
|
+
"CHF"=> '756',
|
35
|
+
"GBP"=> '826',
|
36
|
+
"USD"=> '840',
|
37
|
+
"EUR"=> '978'
|
38
|
+
}
|
39
|
+
|
40
|
+
SUCCESS_CODES = ['00000']
|
41
|
+
UNAVAILABILITY_CODES = ['00001', '00097', '00098']
|
42
|
+
SUCCESS_MESSAGE = 'The transaction was approved'
|
43
|
+
FAILURE_MESSAGE = 'The transaction failed'
|
44
|
+
|
45
|
+
# Money is referenced in cents
|
46
|
+
self.money_format = :cents
|
47
|
+
self.default_currency = 'EUR'
|
48
|
+
|
49
|
+
# The countries the gateway supports merchants from as 2 digit ISO country codes
|
50
|
+
self.supported_countries = ['FR']
|
51
|
+
|
52
|
+
# The card types supported by the payment gateway
|
53
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
54
|
+
|
55
|
+
# The homepage URL of the gateway
|
56
|
+
self.homepage_url = 'http://www.paybox.com/'
|
57
|
+
|
58
|
+
# The name of the gateway
|
59
|
+
self.display_name = 'Paybox Direct'
|
60
|
+
|
61
|
+
def initialize(options = {})
|
62
|
+
requires!(options, :login, :password)
|
63
|
+
super
|
64
|
+
end
|
65
|
+
|
66
|
+
def authorize(money, creditcard, options = {})
|
67
|
+
post = {}
|
68
|
+
add_invoice(post, options)
|
69
|
+
add_creditcard(post, creditcard)
|
70
|
+
commit('authorization', money, post)
|
71
|
+
end
|
72
|
+
|
73
|
+
def purchase(money, creditcard, options = {})
|
74
|
+
post = {}
|
75
|
+
add_invoice(post, options)
|
76
|
+
add_creditcard(post, creditcard)
|
77
|
+
commit('purchase', money, post)
|
78
|
+
end
|
79
|
+
|
80
|
+
def capture(money, authorization, options = {})
|
81
|
+
requires!(options, :order_id)
|
82
|
+
post = {}
|
83
|
+
add_invoice(post, options)
|
84
|
+
post[:numappel] = authorization[0,10]
|
85
|
+
post[:numtrans] = authorization[10,10]
|
86
|
+
commit('capture', money, post)
|
87
|
+
end
|
88
|
+
|
89
|
+
def void(identification, options = {})
|
90
|
+
requires!(options, :order_id, :amount)
|
91
|
+
post ={}
|
92
|
+
add_invoice(post, options)
|
93
|
+
add_reference(post, identification)
|
94
|
+
post[:porteur] = '000000000000000'
|
95
|
+
post[:dateval] = '0000'
|
96
|
+
commit('void', options[:amount], post)
|
97
|
+
end
|
98
|
+
|
99
|
+
def credit(money, identification, options = {})
|
100
|
+
deprecated CREDIT_DEPRECATION_MESSAGE
|
101
|
+
refund(money, identification, options)
|
102
|
+
end
|
103
|
+
|
104
|
+
def refund(money, identification, options = {})
|
105
|
+
post = {}
|
106
|
+
add_invoice(post, options)
|
107
|
+
add_reference(post, identification)
|
108
|
+
commit('refund', money, post)
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
def add_invoice(post, options)
|
114
|
+
post[:reference] = options[:order_id]
|
115
|
+
end
|
116
|
+
|
117
|
+
def add_creditcard(post, creditcard)
|
118
|
+
post[:porteur] = creditcard.number
|
119
|
+
post[:dateval] = expdate(creditcard)
|
120
|
+
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
|
121
|
+
end
|
122
|
+
|
123
|
+
def add_reference(post, identification)
|
124
|
+
post[:numappel] = identification[0,10]
|
125
|
+
post[:numtrans] = identification[10,10]
|
126
|
+
end
|
127
|
+
|
128
|
+
def parse(body)
|
129
|
+
results = {}
|
130
|
+
body.split(/&/).each do |pair|
|
131
|
+
key,val = pair.split(/\=/)
|
132
|
+
results[key.downcase.to_sym] = CGI.unescape(val) if val
|
133
|
+
end
|
134
|
+
results
|
135
|
+
end
|
136
|
+
|
137
|
+
def commit(action, money = nil, parameters = nil)
|
138
|
+
parameters[:montant] = ('0000000000' + (money ? amount(money) : ''))[-10..-1]
|
139
|
+
parameters[:devise] = CURRENCY_CODES[options[:currency] || currency(money)]
|
140
|
+
request_data = post_data(action,parameters)
|
141
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, request_data))
|
142
|
+
response = parse(ssl_post(self.live_url_backup, request_data)) if service_unavailable?(response) && !test?
|
143
|
+
Response.new(success?(response), message_from(response), response.merge(
|
144
|
+
:timestamp => parameters[:dateq]),
|
145
|
+
:test => test?,
|
146
|
+
:authorization => response[:numappel].to_s + response[:numtrans].to_s,
|
147
|
+
:fraud_review => false,
|
148
|
+
:sent_params => parameters.delete_if{|key,value| ['porteur','dateval','cvv'].include?(key.to_s)}
|
149
|
+
)
|
150
|
+
end
|
151
|
+
|
152
|
+
def success?(response)
|
153
|
+
SUCCESS_CODES.include?(response[:codereponse])
|
154
|
+
end
|
155
|
+
|
156
|
+
def service_unavailable?(response)
|
157
|
+
UNAVAILABILITY_CODES.include?(response[:codereponse])
|
158
|
+
end
|
159
|
+
|
160
|
+
def message_from(response)
|
161
|
+
success?(response) ? SUCCESS_MESSAGE : (response[:commentaire] || FAILURE_MESSAGE)
|
162
|
+
end
|
163
|
+
|
164
|
+
def post_data(action, parameters = {})
|
165
|
+
|
166
|
+
parameters.update(
|
167
|
+
:version => API_VERSION,
|
168
|
+
:type => TRANSACTIONS[action.to_sym],
|
169
|
+
:dateq => Time.now.strftime('%d%m%Y%H%M%S'),
|
170
|
+
:numquestion => unique_id(parameters[:order_id]),
|
171
|
+
:site => @options[:login].to_s[0,7],
|
172
|
+
:rang => @options[:login].to_s[7..-1],
|
173
|
+
:cle => @options[:password],
|
174
|
+
:pays => '',
|
175
|
+
:archivage => parameters[:order_id]
|
176
|
+
)
|
177
|
+
|
178
|
+
parameters.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join("&")
|
179
|
+
end
|
180
|
+
|
181
|
+
def unique_id(seed = 0)
|
182
|
+
randkey = "#{seed}#{Time.now.usec}".to_i % 2147483647 # Max paybox value for the question number
|
183
|
+
|
184
|
+
"0000000000#{randkey}"[-10..-1]
|
185
|
+
end
|
186
|
+
|
187
|
+
def expdate(credit_card)
|
188
|
+
year = sprintf("%.4i", credit_card.year)
|
189
|
+
month = sprintf("%.2i", credit_card.month)
|
190
|
+
|
191
|
+
"#{month}#{year[-2..-1]}"
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
@@ -0,0 +1,209 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
module ActiveMerchant #:nodoc:
|
3
|
+
module Billing #:nodoc:
|
4
|
+
module PayflowCommonAPI
|
5
|
+
def self.included(base)
|
6
|
+
base.default_currency = 'USD'
|
7
|
+
|
8
|
+
base.class_attribute :partner
|
9
|
+
|
10
|
+
# Set the default partner to PayPal
|
11
|
+
base.partner = 'PayPal'
|
12
|
+
|
13
|
+
base.supported_countries = ['US', 'CA', 'SG', 'AU']
|
14
|
+
|
15
|
+
base.class_attribute :timeout
|
16
|
+
base.timeout = 60
|
17
|
+
|
18
|
+
base.test_url = 'https://pilot-payflowpro.paypal.com'
|
19
|
+
base.live_url = 'https://payflowpro.paypal.com'
|
20
|
+
|
21
|
+
# Enable safe retry of failed connections
|
22
|
+
# Payflow is safe to retry because retried transactions use the same
|
23
|
+
# X-VPS-Request-ID header. If a transaction is detected as a duplicate
|
24
|
+
# only the original transaction data will be used by Payflow, and the
|
25
|
+
# subsequent Responses will have a :duplicate parameter set in the params
|
26
|
+
# hash.
|
27
|
+
base.retry_safe = true
|
28
|
+
end
|
29
|
+
|
30
|
+
XMLNS = 'http://www.paypal.com/XMLPay'
|
31
|
+
|
32
|
+
CARD_MAPPING = {
|
33
|
+
:visa => 'Visa',
|
34
|
+
:master => 'MasterCard',
|
35
|
+
:discover => 'Discover',
|
36
|
+
:american_express => 'Amex',
|
37
|
+
:jcb => 'JCB',
|
38
|
+
:diners_club => 'DinersClub',
|
39
|
+
:switch => 'Switch',
|
40
|
+
:solo => 'Solo'
|
41
|
+
}
|
42
|
+
|
43
|
+
TRANSACTIONS = {
|
44
|
+
:purchase => "Sale",
|
45
|
+
:authorization => "Authorization",
|
46
|
+
:capture => "Capture",
|
47
|
+
:void => "Void",
|
48
|
+
:credit => "Credit"
|
49
|
+
}
|
50
|
+
|
51
|
+
CVV_CODE = {
|
52
|
+
'Match' => 'M',
|
53
|
+
'No Match' => 'N',
|
54
|
+
'Service Not Available' => 'U',
|
55
|
+
'Service not Requested' => 'P'
|
56
|
+
}
|
57
|
+
|
58
|
+
def initialize(options = {})
|
59
|
+
requires!(options, :login, :password)
|
60
|
+
|
61
|
+
options[:partner] = partner if options[:partner].blank?
|
62
|
+
super
|
63
|
+
end
|
64
|
+
|
65
|
+
def capture(money, authorization, options = {})
|
66
|
+
request = build_reference_request(:capture, money, authorization, options)
|
67
|
+
commit(request, options)
|
68
|
+
end
|
69
|
+
|
70
|
+
def void(authorization, options = {})
|
71
|
+
request = build_reference_request(:void, nil, authorization, options)
|
72
|
+
commit(request, options)
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
def build_request(body, options = {})
|
77
|
+
xml = Builder::XmlMarkup.new
|
78
|
+
xml.instruct!
|
79
|
+
xml.tag! 'XMLPayRequest', 'Timeout' => timeout.to_s, 'version' => "2.1", "xmlns" => XMLNS do
|
80
|
+
xml.tag! 'RequestData' do
|
81
|
+
xml.tag! 'Vendor', @options[:login]
|
82
|
+
xml.tag! 'Partner', @options[:partner]
|
83
|
+
if options[:request_type] == :recurring
|
84
|
+
xml << body
|
85
|
+
else
|
86
|
+
xml.tag! 'Transactions' do
|
87
|
+
xml.tag! 'Transaction', 'CustRef' => options[:customer] do
|
88
|
+
xml.tag! 'Verbosity', 'MEDIUM'
|
89
|
+
xml << body
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
xml.tag! 'RequestAuth' do
|
95
|
+
xml.tag! 'UserPass' do
|
96
|
+
xml.tag! 'User', !@options[:user].blank? ? @options[:user] : @options[:login]
|
97
|
+
xml.tag! 'Password', @options[:password]
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
xml.target!
|
102
|
+
end
|
103
|
+
|
104
|
+
def build_reference_request(action, money, authorization, options)
|
105
|
+
xml = Builder::XmlMarkup.new
|
106
|
+
xml.tag! TRANSACTIONS[action] do
|
107
|
+
xml.tag! 'PNRef', authorization
|
108
|
+
|
109
|
+
unless money.nil?
|
110
|
+
xml.tag! 'Invoice' do
|
111
|
+
xml.tag!('TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money))
|
112
|
+
xml.tag!('Description', options[:description]) unless options[:description].blank?
|
113
|
+
xml.tag!('Comment', options[:comment]) unless options[:comment].blank?
|
114
|
+
xml.tag!('ExtData', 'Name'=> 'COMMENT2', 'Value'=> options[:comment2]) unless options[:comment2].blank?
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
xml.target!
|
120
|
+
end
|
121
|
+
|
122
|
+
def add_address(xml, tag, address, options)
|
123
|
+
return if address.nil?
|
124
|
+
xml.tag! tag do
|
125
|
+
xml.tag! 'Name', address[:name] unless address[:name].blank?
|
126
|
+
xml.tag! 'EMail', options[:email] unless options[:email].blank?
|
127
|
+
xml.tag! 'Phone', address[:phone] unless address[:phone].blank?
|
128
|
+
xml.tag! 'CustCode', options[:customer] if !options[:customer].blank? && tag == 'BillTo'
|
129
|
+
xml.tag! 'PONum', options[:po_number] if !options[:po_number].blank? && tag == 'BillTo'
|
130
|
+
|
131
|
+
xml.tag! 'Address' do
|
132
|
+
xml.tag! 'Street', address[:address1] unless address[:address1].blank?
|
133
|
+
xml.tag! 'City', address[:city] unless address[:city].blank?
|
134
|
+
xml.tag! 'State', address[:state].blank? ? "N/A" : address[:state]
|
135
|
+
xml.tag! 'Country', address[:country] unless address[:country].blank?
|
136
|
+
xml.tag! 'Zip', address[:zip] unless address[:zip].blank?
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def parse(data)
|
142
|
+
response = {}
|
143
|
+
xml = Nokogiri::XML(data)
|
144
|
+
xml.remove_namespaces!
|
145
|
+
root = xml.xpath("//ResponseData")
|
146
|
+
|
147
|
+
# REXML::XPath in Ruby 1.8.6 is now unable to match nodes based on their attributes
|
148
|
+
tx_result = root.xpath(".//TransactionResult").first
|
149
|
+
|
150
|
+
if tx_result && tx_result.attributes['Duplicate'].to_s == "true"
|
151
|
+
response[:duplicate] = true
|
152
|
+
end
|
153
|
+
|
154
|
+
root.xpath(".//*").each do |node|
|
155
|
+
parse_element(response, node)
|
156
|
+
end
|
157
|
+
|
158
|
+
response
|
159
|
+
end
|
160
|
+
|
161
|
+
def parse_element(response, node)
|
162
|
+
node_name = node.name.underscore.to_sym
|
163
|
+
case
|
164
|
+
when node_name == :rp_payment_result
|
165
|
+
# Since we'll have multiple history items, we can't just flatten everything
|
166
|
+
# down as we do everywhere else. RPPaymentResult elements are not contained
|
167
|
+
# in an RPPaymentResults element so we'll come here multiple times
|
168
|
+
response[node_name] ||= []
|
169
|
+
response[node_name] << ( payment_result_response = {} )
|
170
|
+
node.xpath(".//*").each{ |e| parse_element(payment_result_response, e) }
|
171
|
+
when node.xpath(".//*").to_a.any?
|
172
|
+
node.xpath(".//*").each{|e| parse_element(response, e) }
|
173
|
+
when node_name.to_s =~ /amt$/
|
174
|
+
# *Amt elements don't put the value in the #text - instead they use a Currency attribute
|
175
|
+
response[node_name] = node.attributes['Currency'].to_s
|
176
|
+
when node_name == :ext_data
|
177
|
+
response[node.attributes['Name'].to_s.underscore.to_sym] = node.attributes['Value'].to_s
|
178
|
+
else
|
179
|
+
response[node_name] = node.text
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
def build_headers(content_length)
|
184
|
+
{
|
185
|
+
"Content-Type" => "text/xml",
|
186
|
+
"Content-Length" => content_length.to_s,
|
187
|
+
"X-VPS-Client-Timeout" => timeout.to_s,
|
188
|
+
"X-VPS-VIT-Integration-Product" => "ActiveMerchant",
|
189
|
+
"X-VPS-VIT-Runtime-Version" => RUBY_VERSION,
|
190
|
+
"X-VPS-Request-ID" => Utils.generate_unique_id
|
191
|
+
}
|
192
|
+
end
|
193
|
+
|
194
|
+
def commit(request_body, options = {})
|
195
|
+
request = build_request(request_body, options)
|
196
|
+
headers = build_headers(request.size)
|
197
|
+
|
198
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, request, headers))
|
199
|
+
|
200
|
+
build_response(response[:result] == "0", response[:message], response,
|
201
|
+
:test => test?,
|
202
|
+
:authorization => response[:pn_ref] || response[:rp_ref],
|
203
|
+
:cvv_result => CVV_CODE[response[:cv_result]],
|
204
|
+
:avs_result => { :code => response[:avs_result] }
|
205
|
+
)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class PayflowExpressResponse < Response
|
4
|
+
def email
|
5
|
+
@params['e_mail']
|
6
|
+
end
|
7
|
+
|
8
|
+
def full_name
|
9
|
+
"#{@params['name']} #{@params['lastname']}"
|
10
|
+
end
|
11
|
+
|
12
|
+
def token
|
13
|
+
@params['token']
|
14
|
+
end
|
15
|
+
|
16
|
+
def payer_id
|
17
|
+
@params['payer_id']
|
18
|
+
end
|
19
|
+
|
20
|
+
# Really the shipping country, but it is all the information provided
|
21
|
+
def payer_country
|
22
|
+
address['country']
|
23
|
+
end
|
24
|
+
|
25
|
+
def address
|
26
|
+
{ 'name' => full_name,
|
27
|
+
'company' => nil,
|
28
|
+
'address1' => @params['street'],
|
29
|
+
'address2' => @params['shiptostreet2'] || @params['street2'],
|
30
|
+
'city' => @params['city'],
|
31
|
+
'state' => @params['state'],
|
32
|
+
'country' => @params['country'],
|
33
|
+
'zip' => @params['zip'],
|
34
|
+
'phone' => nil
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class PayflowResponse < Response
|
4
|
+
def profile_id
|
5
|
+
@params['profile_id']
|
6
|
+
end
|
7
|
+
|
8
|
+
def payment_history
|
9
|
+
@payment_history ||= @params['rp_payment_result'].collect{ |result| result.stringify_keys } rescue []
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|