angular-payments
angular-payments copied to clipboard
Specific $scope bindings
Why must the inputs be bound to $scope.number, $scope.expiry and $scope.cvc? It would be very nice if they could be bound to any $scope property. For example my scope already has so many properties and I would like to group the stripe ones under $scope.stripe. Is this possible?
I know this question is old but I too just stumbled upon this issue. Were you able to resolve the issue @steveops ?
not sure if this is still relevant for someone, but in case:
you can achieve using $scope.stripe if you change in angular-payments.js in the method _getDataToSend the for(i in possibleKeys){
part to (I guess this is quite dirty but works for me):
for(i in possibleKeys){
if(possibleKeys[i] == "number" || possibleKeys[i] == "cvc" ){
ret[camelToSnake(possibleKeys[i])] = angular.copy(data.$parent.stripe[possibleKeys[i]]);
} else {
if(data.hasOwnProperty(possibleKeys[i])){
ret[camelToSnake(possibleKeys[i])] = angular.copy(data[possibleKeys[i]]);
}
}
}