Purchase() public method

Attempts to debit the specified amount from the supplied payment card.
public Purchase ( string merchantReference, Kurejito.Payments.Money amount, PaymentCard card ) : PaymentResponse
merchantReference string An alphanumeric reference supplied by the merchant that uniquely identifies this transaction
amount Kurejito.Payments.Money The amount of money to be debited from the payment card (includes the ISO4217 currency code).
card Kurejito.Payments.PaymentCard An instance of containing the customer's payment card details.
return PaymentResponse
示例#1
0
 public void FakeBank_Declines_Payments_Over_Ten_Pounds()
 {
     var gw = new PaymentGateway();
     var response = gw.Purchase("pay001", new Money(10.01m, new Currency("GBP")), new PaymentCard());
     Assert.Equal(PaymentStatus.Declined, response.Status);
 }
示例#2
0
 public void FakeBank_Approves_Payments_Under_Ten_Pounds()
 {
     var gw = new PaymentGateway();
     var response = gw.Purchase("pay001", new Money(9.99m, new Currency("GBP")), new PaymentCard());
     Assert.Equal(PaymentStatus.Ok, response.Status);
 }