mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Filled with `PaymentCtrl.isSelected(payment_method_id)` Therefore, each time a stripe payment is selected, the one that is actually selected is linked to `AdminStripeElements.card` and `AdminStripeElements.stripe`
14 lines
543 B
CoffeeScript
14 lines
543 B
CoffeeScript
angular.module("admin.payments").controller "PaymentCtrl", ($scope, Payment, StatusMessage) ->
|
|
$scope.form_data = Payment.form_data
|
|
$scope.submitted = false
|
|
$scope.StatusMessage = StatusMessage
|
|
|
|
$scope.submitPayment = () ->
|
|
return false if $scope.submitted
|
|
$scope.submitted = true
|
|
StatusMessage.display 'progress', t("spree.admin.payments.source_forms.stripe.submitting_payment")
|
|
Payment.purchase()
|
|
|
|
$scope.isSelected = (payment_method_id) ->
|
|
return parseInt($scope.form_data.payment_method) == payment_method_id
|