Closed franklintarter closed 6 years ago
Those nonces are for card verifications, not transactions:
PaymentMethodRequest request = new PaymentMethodRequest
{
CustomerId = "the_customer_id",
PaymentMethodNonce = nonceFromTheClient,
Options = new PaymentMethodOptionsRequest
{
VerifyCard = true
}
};
Result<PaymentMethod> result = gateway.PaymentMethod.Create(request);
I'll pass along your feedback to our docs team to make that clearer. I can see how it is confusing.
Thank you for clearing that up, @crookedneighbor ! As a suggestion could there be the possibility of creating nonces to simulate processor response codes for Transactions? Or is using transaction amounts the only feasible way to test those response types with Transactions?
I can certainly get by and do adequate testing using transaction amounts. I would consider it a "nice to have" option to use nonces for some use cases. For example: a large integration test (almost end to end) that covers both internal order logic (where the price is set by products/discounts/taxes) and charging Braintree transactions.
Thank you for your time.
I'll pass your feedback on about the additional nonces, but that's not on our roadmap at this time.
General information
Issue description
I am writing integration tests for an online store. Currently, I am testing the non-happy path using the Processor_Rejected Nonces here but when I build a workflow it comes back with a successful result.
Note: I have other statuses being tested with the Valid, Gateway_Rejected, and Validation_Failure nonces, and those seem to be behaving correctly. It is only the nonces listed under Processor_Declined that are behaving unexpectedly for me.
As a side note, I wouldn't mind being able to test the TransactionStatus.FAILED with another nonce that triggers that type of failure, but perhaps there is a better way to spoof that than a nonce? If so I don't see a super obvious way to trigger that type of failure in the docs.
My code is something like this (it's currently split up into quite a few files via NUnit and test runners, but this is essentially the flow):
Thank you so much in advance. So far everything in this SDK and the documentation is very top notch!