Skip to content

Instantly share code, notes, and snippets.

@lkobashigawa
Last active August 29, 2015 14:10
Show Gist options
  • Save lkobashigawa/4a0c35ce4d729323d598 to your computer and use it in GitHub Desktop.
Save lkobashigawa/4a0c35ce4d729323d598 to your computer and use it in GitHub Desktop.
auth-net-cim createCustomerPaymentProfile validationMode
var sinon = require('sinon');
it("Should be able to set the validation mode", function(done) {
var spy = sinon.spy(AuthorizeCIM.AuthorizeRequest, 'send');
var date = new Date();
var options = {
customerType: 'individual',
payment: new Authorize.Payment({
creditCard: new Authorize.CreditCard({
cardNumber: '4111111111111111',
expirationDate: (date.getFullYear()+1) + '-10'
})
})
}
AuthorizeCIM.createCustomerPaymentProfile({
customerProfileId: this.customerProfileId,
validationMode: 'liveMode',
paymentProfile: options
}, function(err,resp) {
var call = spy.firstCall;
expect(call.args[2].validationMode).to.equal('liveMode'); //passes
expect(call.thisValue.validationMode).to.equal('liveMode'); //fails
done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment