Last active
August 29, 2015 14:10
-
-
Save lkobashigawa/4a0c35ce4d729323d598 to your computer and use it in GitHub Desktop.
auth-net-cim createCustomerPaymentProfile validationMode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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