Add a directive attribute 'selected' that update AdminStripeElements when true

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`
This commit is contained in:
Jean-Baptiste Bellet
2021-11-22 11:07:26 +01:00
parent 5348d26054
commit 5575697c9f
4 changed files with 12 additions and 5 deletions

View File

@@ -8,3 +8,6 @@ angular.module("admin.payments").controller "PaymentCtrl", ($scope, Payment, Sta
$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