C# Class Kurejito.Gateways.SagePay.VspDirect.SagePayPaymentGateway

A payment gateway interface to the SagePay VspDirect payment system.
Inheritance: IPurchase
Show file Open project: Kurejito/Kurejito Class Usage Examples

Public Methods

Method Description
Accepts ( Currency currency, CardType cardType ) : bool
Purchase ( string merchantReference, Kurejito.Payments.Money amount, PaymentCard card ) : PaymentResponse

Attempts to debit the specified amount from the supplied payment card.

Because the SagePay gateway requires a shopping basket, this overload will create a simple basket containing a single line item whose description is auto-generated from the supplied order details.

SagePayPaymentGateway ( IHttpPostTransport http, string vendorName, decimal vpsProtocol, GatewayMode mode ) : System

Construct a new SagePayPaymentGateway that uses the supplied IHttpPostTransport to communicate with the remote server.

Private Methods

Method Description
CreateBasketString ( string merchantReference, decimal amount ) : string
ExtractStatus ( string pair ) : PaymentStatus
FormatPostData ( string>.IDictionary data ) : string
MakePostData ( ) : string>.IDictionary
ParseResponse ( string postResponse ) : PaymentResponse
PopulateResponseProperty ( PaymentResponse response, string pair ) : void
Tokenize ( string postResponse ) : IEnumerable
TranslateCardType ( CardType cardType ) : string

Method Details

Accepts() public method

public Accepts ( Currency currency, CardType cardType ) : bool
currency System.Currency
cardType CardType
return bool

Purchase() public method

Attempts to debit the specified amount from the supplied payment card.
Because the SagePay gateway requires a shopping basket, this overload will create a simple basket containing a single line item whose description is auto-generated from the supplied order details.
public Purchase ( string merchantReference, Kurejito.Payments.Money amount, PaymentCard card ) : PaymentResponse
merchantReference string
amount Kurejito.Payments.Money
card Kurejito.Payments.PaymentCard
return PaymentResponse

SagePayPaymentGateway() public method

Construct a new SagePayPaymentGateway that uses the supplied IHttpPostTransport to communicate with the remote server.
public SagePayPaymentGateway ( IHttpPostTransport http, string vendorName, decimal vpsProtocol, GatewayMode mode ) : System
http IHttpPostTransport An instance of a class implementing to provide HTTP POST capabilities.
vendorName string The vendor name used by this SagePay installation.
vpsProtocol decimal The version of the VPS Protocol used by the remote SagePay system.
mode GatewayMode
return System