mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
using stripe api
This commit is contained in:
parent
d3d2434654
commit
a56112a47f
@ -782,6 +782,9 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs',
|
||||
// Shows the schedule info in the modal
|
||||
$scope.schedule = schedule.payment_schedule;
|
||||
|
||||
// how should we collect payments for the payment schedule
|
||||
$scope.payment_method = 'stripe';
|
||||
|
||||
// Button label
|
||||
if ($scope.amount > 0) {
|
||||
$scope.validButtonName = _t('app.shared.cart.confirm_payment_of_html', { ROLE: $rootScope.currentUser.role, AMOUNT: $filter('currency')($scope.amount) });
|
||||
|
@ -18,7 +18,19 @@
|
||||
<p>{{ plan | humanReadablePlanName }}</p>
|
||||
</div>
|
||||
<div ng-if="schedule">
|
||||
<p translate translate-values="{DEADLINES: schedule.items.length}">{{ 'app.shared.valid_reservation_modal.payment_schedule' }}</p>
|
||||
<payment-schedule-summary schedule="schedule"></payment-schedule-summary>
|
||||
<label for="method" translate>{{ 'app.shared.valid_reservation_modal.payment_method' }}</label>
|
||||
<select id="method"
|
||||
class="form-control m-b"
|
||||
ng-model="payment_method">
|
||||
<option value="stripe" translate>{{ 'app.shared.valid_reservation_modal.method_stripe' }}</option>
|
||||
<option value="check" translate>{{ 'app.shared.valid_reservation_modal.method_check' }}</option>
|
||||
<!-- TODO, pay 1st deadline with wallet -->
|
||||
<!-- TODO, notify about unable to pay with the wallet -->
|
||||
<!-- TODO, compute 1st deadline with wallet -->
|
||||
</select>
|
||||
<p ng-show="payment_method == 'stripe'" translate>{{ 'app.shared.valid_reservation_modal.stripe_collection_info' }}</p>
|
||||
<p ng-show="payment_method == 'check'" translate translate-values="{DEADLINES: schedule.items.length}">{{ 'app.shared.valid_reservation_modal.check_collection_info' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
@ -15,6 +15,8 @@ class InvoiceReferenceService
|
||||
|
||||
# remove information about online selling (X[text])
|
||||
reference.gsub!(/X\[([^\]]+)\]/, ''.to_s)
|
||||
# remove information about payment schedule (S[text])
|
||||
reference.gsub!(/S\[([^\]]+)\]/, ''.to_s)
|
||||
elsif payment_schedule
|
||||
# information about payment schedule
|
||||
reference.gsub!(/S\[([^\]]+)\]/, '\1')
|
||||
@ -32,6 +34,8 @@ class InvoiceReferenceService
|
||||
|
||||
# remove information about refunds (R[text])
|
||||
reference.gsub!(/R\[([^\]]+)\]/, ''.to_s)
|
||||
# remove information about payment schedule (S[text])
|
||||
reference.gsub!(/S\[([^\]]+)\]/, ''.to_s)
|
||||
end
|
||||
|
||||
reference
|
||||
@ -142,7 +146,7 @@ class InvoiceReferenceService
|
||||
# @param klass {ActiveRecord::Base}
|
||||
##
|
||||
def get_max_id(klass)
|
||||
ActiveRecord::Base.connection.execute("SELECT max(id) FROM #{klass.table_name}").getvalue(0, 0)
|
||||
ActiveRecord::Base.connection.execute("SELECT max(id) FROM #{klass.table_name}").getvalue(0, 0) || 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -111,7 +111,7 @@ class StripeWorker
|
||||
|
||||
stp_subscription = Stripe::Subscription.create({
|
||||
customer: payment_schedule.invoicing_profile.user.stp_customer_id,
|
||||
cancel_at: payment_schedule.scheduled.expiration_date,
|
||||
cancel_at: payment_schedule.scheduled.expiration_date.to_i,
|
||||
promotion_code: payment_schedule.coupon&.code,
|
||||
add_invoice_items: items,
|
||||
items: [
|
||||
|
@ -129,7 +129,11 @@ fr:
|
||||
here_is_the_summary_of_the_slots_to_book_for_the_current_user: "Voici le récapitulatif des créneaux à réserver pour l'utilisateur courant :"
|
||||
subscription_confirmation: "Validation de l'abonnement"
|
||||
here_is_the_subscription_summary: "Voici le récapitulatif de l'abonnement :"
|
||||
payment_schedule: "Cet abonnement est souscrit par un échéancier de paiement sur {DEADLINES} mois. En validant, vous confirmez encaisser la première mensualité."
|
||||
payment_method: "Moyen de paiement"
|
||||
method_stripe: "Carte bancaire en ligne"
|
||||
method_check: "Par chèques"
|
||||
stripe_collection_info: "En validant, vous serez invité à saisir les informations de carte bancaire du membre. Cette carte sera prélevée automatiquement aux échéances."
|
||||
check_collection_info: "En validant, vous confirmez être en possession de {DEADLINES} chèques permettant d'encaisser l'ensemble des mensualité."
|
||||
#event edition form
|
||||
event:
|
||||
title: "Titre"
|
||||
|
@ -1,3 +1,4 @@
|
||||
scr:
|
||||
date:
|
||||
abbr_day_names:
|
||||
- Ned
|
||||
@ -8,7 +9,7 @@
|
||||
- Pet
|
||||
- Sub
|
||||
abbr_month_names:
|
||||
-
|
||||
-
|
||||
- Jan
|
||||
- Feb
|
||||
- Mar
|
||||
@ -34,7 +35,7 @@
|
||||
long: ! '%B %e, %Y'
|
||||
short: ! '%e %b'
|
||||
month_names:
|
||||
-
|
||||
-
|
||||
- Januar
|
||||
- Februar
|
||||
- Mart
|
||||
|
Loading…
x
Reference in New Issue
Block a user