| Class | ActiveMerchant::Billing::LinkpointGateway |
| In: |
lib/active_merchant/billing/gateways/linkpoint.rb
|
| Parent: | Gateway |
Initialization Options :login Your store number :pem The text of your linkpoint PEM file. Note
this is not the path to file, but its
contents. If you are only using one PEM
file on your site you can declare it
globally and then you won't need to
include this option
A valid store number is required. Unfortunately, with LinkPoint YOU CAN‘T JUST USE ANY OLD STORE NUMBER. Also, you can‘t just generate your own PEM file. You‘ll need to use a special PEM file provided by LinkPoint.
Go to www.linkpoint.com/support/sup_teststore.asp to set up a test account and obtain your PEM file.
Declaring PEM file Globally ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(FILE) + ’/../mycert.pem’ )
Valid Order Options :result =>
LIVE Production mode GOOD Approved response in test mode DECLINE Declined response in test mode DUPLICATE Duplicate response in test mode
:ponumber Order number
:transactionorigin => Source of the transaction
ECI Email or Internet MAIL Mail order MOTO Mail order/Telephone TELEPHONE Telephone RETAIL Face-to-face
:ordertype =>
SALE Real live sale PREAUTH Authorize only POSTAUTH Forced Ticket or Ticket Only transaction VOID CREDIT CALCSHIPPING For shipping charges calculations CALCTAX For sales tax calculations
Recurring Options :action =>
SUBMIT MODIFY CANCEL
:installments Identifies how many recurring payments to charge the customer :startdate Date to begin charging the recurring payments. Format: YYYYMMDD or "immediate" :periodicity =>
MONTHLY
BIMONTHLY
WEEKLY
BIWEEKLY
YEARLY
DAILY
:threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant. :comments Uh… comments
For reference:
www.linkpointcentral.com/lpc/docs/Help/APIHelp/lpintguide.htm
Entities = {
:payment => [:subtotal, :tax, :vattax, :shipping, :chargetotal],
:billing => [:name, :address1, :address2, :city, :state, :zip, :country, :email, :phone, :fax, :addrnum],
:shipping => [:name, :address1, :address2, :city, :state, :zip, :country, :weight, :items, :carrier, :total],
:creditcard => [:cardnumber, :cardexpmonth, :cardexpyear, :cvmvalue, :track],
:telecheck => [:routing, :account, :checknumber, :bankname, :bankstate, :dl, :dlstate, :void, :accounttype, :ssn],
:transactiondetails => [:transactionorigin, :oid, :ponumber, :taxexempt, :terminaltype, :ip, :reference_number, :recurring, :tdate],
:periodic => [:action, :installments, :threshold, :startdate, :periodicity, :comments],
:notes => [:comments, :referred]
}
IMPORTANT NOTICE:
LinkPoint‘s Items entity is not yet supported in this module.
| TEST_URL | = | 'https://staging.linkpt.net:1129/' |
| LIVE_URL | = | 'https://secure.linkpt.net:1129/' |
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 112
112: def initialize(options = {})
113: requires!(options, :login)
114:
115: @options = {
116: :result => 'LIVE',
117: :pem => LinkpointGateway.pem_file
118: }.update(options)
119:
120: raise ArgumentError, "You need to pass in your pem file using the :pem parameter or set it globally using ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(__FILE__) + '/../mycert.pem' ) or similar" if @options[:pem].blank?
121: end
Authorize the transaction
Reserves the funds on the customer‘s credit card, but does not charge the card.
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 171
171: def authorize(money, creditcard, options = {})
172: requires!(options, :order_id)
173: options.update(
174: :ordertype => "PREAUTH"
175: )
176: commit(money, creditcard, options)
177: end
Post an authorization.
Captures the funds from an authorized transaction. Order_id must be a valid order id from a prior authorized transaction.
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 185
185: def capture(money, authorization, options = {})
186: options.update(
187: :order_id => authorization,
188: :ordertype => "POSTAUTH"
189: )
190: commit(money, nil, options)
191: end
Refund an order
identification must be a valid order id previously submitted by SALE
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 207
207: def credit(money, identification, options = {})
208: options.update(
209: :ordertype => "CREDIT",
210: :order_id => identification
211: )
212: commit(money, nil, options)
213: end
Buy the thing
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 158
158: def purchase(money, creditcard, options={})
159: requires!(options, :order_id)
160: options.update(
161: :ordertype => "SALE"
162: )
163: commit(money, creditcard, options)
164: end
Send a purchase request with periodic options Recurring Options :action =>
SUBMIT MODIFY CANCEL
:installments Identifies how many recurring payments to charge the customer :startdate Date to begin charging the recurring payments. Format: YYYYMMDD or "immediate" :periodicity =>
:monthly
:bimonthly
:weekly
:biweekly
:yearly
:daily
:threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant. :comments Uh… comments
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 142
142: def recurring(money, creditcard, options={})
143: requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily], :installments, :order_id )
144:
145: options.update(
146: :ordertype => "SALE",
147: :action => options[:action] || "SUBMIT",
148: :installments => options[:installments] || 12,
149: :startdate => options[:startdate] || "immediate",
150: :periodicity => options[:periodicity].to_s || "monthly",
151: :comments => options[:comments] || nil,
152: :threshold => options[:threshold] || 3
153: )
154: commit(money, creditcard, options)
155: end
# File lib/active_merchant/billing/gateways/linkpoint.rb, line 215
215: def test?
216: @options[:test] || super
217: end