psoft.epayment
Interface MerchantGateway

All Known Implementing Classes:
GenericMerchantGateway

public interface MerchantGateway

The interface used to process payments for PaymentInstruments such as credit cards, web processors, or checks


Field Summary
static int AUTH
          Specifies that a transaction authorizes the credit card.
static int CAPTURE
          Specifies that a transaction is completed.
static int CHARGE
          Specifies that a transaction charges amount without prior authorization.
static int REFUND
          Specifies that a transaction refunds an amount.
static int VOID
          Specifies that a transaction cancells an amount.
 
Method Summary
 java.util.HashMap authorize(long id, java.lang.String description, double amount, PaymentInstrument pi)
          Authorizes to charge provided amount from the PaymentInstrument using Merchant Gateway.
 java.util.HashMap authorize(java.lang.String description, double amount, PaymentInstrument pi)
          Authorizes to charge provided amount from the PaymentInstrument using Merchant Gateway.
 java.util.HashMap capture(long id, java.lang.String description, java.util.HashMap data, PaymentInstrument pi)
          Captures pre-authorized amount from the PaymentInstrument
 java.util.HashMap capture(java.lang.String description, java.util.HashMap data, PaymentInstrument pi)
          Captures pre-authorized amount from the PaymentInstrument
 java.util.HashMap charge(long id, java.lang.String description, double amount, PaymentInstrument pi)
          Charges PaymentInstrument using Merchant Gateway.
 java.util.HashMap charge(java.lang.String description, double amount, PaymentInstrument pi)
          Charges PaymentInstrument using Merchant Gateway.
 java.util.HashMap checkCVV(long acctid, PaymentInstrument pi)
          This method is called by hsphere to check CVV value when the credit card details are entered.
 java.lang.String getDescription()
          Returns the description of the merchant gateway
 int getId()
          Returns the unique ID of the merchant account
 java.util.Map getValues()
          Returns configuration of MerchantGateway as key/value pairs
 void init(int id, java.util.HashMap values)
          Initializes MerchantGateway with default values
 void setLog(MerchantGatewayLog log)
          Sets log object where all that transactions will be written
 java.util.HashMap voidAuthorize(long id, java.lang.String description, java.util.HashMap data, PaymentInstrument pi)
          Voids pre-authorized amount from the PaymentInstrument
 java.util.HashMap voidAuthorize(java.lang.String description, java.util.HashMap data, PaymentInstrument pi)
          Voids pre-authorized amount from the PaymentInstrument
 

Field Detail

CHARGE

public static final int CHARGE

Specifies that a transaction charges amount without prior authorization.

See Also:
Constant Field Values

AUTH

public static final int AUTH

Specifies that a transaction authorizes the credit card.

See Also:
Constant Field Values

REFUND

public static final int REFUND

Specifies that a transaction refunds an amount.

Not supported.

See Also:
Constant Field Values

VOID

public static final int VOID

Specifies that a transaction cancells an amount.

See Also:
Constant Field Values

CAPTURE

public static final int CAPTURE

Specifies that a transaction is completed.

See Also:
Constant Field Values
Method Detail

getId

public int getId()
Returns the unique ID of the merchant account

Returns:
merchant account ID

getValues

public java.util.Map getValues()
Returns configuration of MerchantGateway as key/value pairs

Returns:
key/value pairs

init

public void init(int id,
                 java.util.HashMap values)
          throws java.lang.Exception
Initializes MerchantGateway with default values

Parameters:
id - merchant account id
values - bundle needed to initialize the MerchantGateway usually values such as login, password, merchant account #
Throws:
java.lang.Exception - in case initialization fails

charge

public java.util.HashMap charge(java.lang.String description,
                                double amount,
                                PaymentInstrument pi)
                         throws java.lang.Exception
Charges PaymentInstrument using Merchant Gateway.

Parameters:
description - description for the gateway
amount - amount to charge
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument

charge

public java.util.HashMap charge(long id,
                                java.lang.String description,
                                double amount,
                                PaymentInstrument pi)
                         throws java.lang.Exception
Charges PaymentInstrument using Merchant Gateway.

Parameters:
id - internal transaction id
description - description for the gateway
amount - amount to charge
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument

authorize

public java.util.HashMap authorize(java.lang.String description,
                                   double amount,
                                   PaymentInstrument pi)
                            throws java.lang.Exception
Authorizes to charge provided amount from the PaymentInstrument using Merchant Gateway.

Parameters:
description - description for the gateway
amount - amount to authorize
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument

authorize

public java.util.HashMap authorize(long id,
                                   java.lang.String description,
                                   double amount,
                                   PaymentInstrument pi)
                            throws java.lang.Exception
Authorizes to charge provided amount from the PaymentInstrument using Merchant Gateway.

Parameters:
id - internal transaction id
description - description for the gateway
amount - amount to authorize
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument

capture

public java.util.HashMap capture(java.lang.String description,
                                 java.util.HashMap data,
                                 PaymentInstrument pi)
                          throws java.lang.Exception
Captures pre-authorized amount from the PaymentInstrument

Parameters:
description - description for the gateway
data - data return by authorize method
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument, MerchantGateway.authorize, MerchantGateway.void

capture

public java.util.HashMap capture(long id,
                                 java.lang.String description,
                                 java.util.HashMap data,
                                 PaymentInstrument pi)
                          throws java.lang.Exception
Captures pre-authorized amount from the PaymentInstrument

Parameters:
id - internal transaction id
description - description for the gateway
data - data return by authorize method
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument, MerchantGateway.authorize, MerchantGateway.void

voidAuthorize

public java.util.HashMap voidAuthorize(java.lang.String description,
                                       java.util.HashMap data,
                                       PaymentInstrument pi)
                                throws java.lang.Exception
Voids pre-authorized amount from the PaymentInstrument

Parameters:
description - description for the gateway
data - data return by authorize method
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument, MerchantGateway.authorize, MerchantGateway.void

voidAuthorize

public java.util.HashMap voidAuthorize(long id,
                                       java.lang.String description,
                                       java.util.HashMap data,
                                       PaymentInstrument pi)
                                throws java.lang.Exception
Voids pre-authorized amount from the PaymentInstrument

Parameters:
id - internal transaction id
description - description for the gateway
data - data return by authorize method
pi - PaymentInstrument information
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception - In case of the error
See Also:
PaymentInstrument, MerchantGateway.authorize, MerchantGateway.void

setLog

public void setLog(MerchantGatewayLog log)
Sets log object where all that transactions will be written

Parameters:
log - - a MerchantGatewayLog

getDescription

public java.lang.String getDescription()
Returns the description of the merchant gateway

Returns:
description of merchant gateway

checkCVV

public java.util.HashMap checkCVV(long acctid,
                                  PaymentInstrument pi)
                           throws java.lang.Exception
This method is called by hsphere to check CVV value when the credit card details are entered.

Parameters:
acctid - - hsphere account/signup ID
pi - PaymentInstrument
Returns:
response from gateway as key/value pairs
Throws:
java.lang.Exception


Copyright © 2005 Positive Software Corporation. All Rights Reserved.