public void CanRefund() { var cim = new CustomerInformationManager(TestHelper.TemplateFactory, ObjectMother.TestAuthentication); var createProfileResponse = cim.Create(_profileAttributes); _profileAttributes.GateWayId = createProfileResponse.Params["customerProfileId"]; var createPaymentProfileResponse = cim.CreatePaymentProfile(_profileAttributes, _addressAttributes, _creditCardAttributes); _paymentProfileAttributes.GateWayId = createPaymentProfileResponse.Params["customerPaymentProfileId"].ToString(); _paymentProfileAttributes.MaskedCreditCard = "XXXX" + _creditCardAttributes.CardNumber.Trim().Substring(_creditCardAttributes.CardNumber.Trim().Length - 4); var gateway = new Gateway(TestHelper.TemplateFactory, ObjectMother.TestAuthentication); var createPaymentProfileTransactionResponse = gateway.Charge(_profileAttributes, _paymentProfileAttributes, _order); _transaction.GateWayId = createPaymentProfileTransactionResponse.Params["directResponseHash"]["PaymentGatewayTransactionId"]; Response refundResponse = gateway.Refund(_profileAttributes, _paymentProfileAttributes, (decimal)100, _transaction); Assert.IsTrue(refundResponse.Success); Assert.IsNotNull(refundResponse.Params["directResponseString"]); Assert.IsNotNull(refundResponse.Params["directResponseHash"]); }
public void CanCreatePaymentProfileTransactionAuthCapture() { var cim = new CustomerInformationManager(TestHelper.TemplateFactory, ObjectMother.TestAuthentication); var createProfileResponse = cim.Create(_profileAttributes); _profileAttributes.GateWayId = createProfileResponse.Params["customerProfileId"]; var createPaymentProfileResponse = cim.CreatePaymentProfile(_profileAttributes, _addressAttributes, _creditCardAttributes); _paymentProfileAttributes.GateWayId = createPaymentProfileResponse.Params["customerPaymentProfileId"].ToString(); var gateway = new Gateway(TestHelper.TemplateFactory, ObjectMother.TestAuthentication); var createPaymentProfileTransactionResponse = gateway.Charge(_profileAttributes, _paymentProfileAttributes, _order); Assert.IsTrue(createPaymentProfileTransactionResponse.Success); Assert.IsNotNull(createPaymentProfileTransactionResponse.Params["directResponseString"]); Assert.IsNotNull(createPaymentProfileTransactionResponse.Params["directResponseHash"]); }