'Name default credit processor',
'coust', 'label'),
oils_i18n_gettext('credit.processor.default',
- 'This might be "AuthorizeNet", "PayPal", etc.',
+ 'This might be "AuthorizeNet", "PayPal", "PayflowPro", or "Stripe".',
'coust', 'description'),
'string', null)
'coust', 'description'),
'string', null)
-,( 'credit.processor.stripe.privatekey', 'credit',
- oils_i18n_gettext('credit.processor.stripe.privatekey',
+,( 'credit.processor.stripe.secretkey', 'credit',
+ oils_i18n_gettext('credit.processor.stripe.secretkey',
'Stripe secret key',
'coust', 'label'),
- oils_i18n_gettext('credit.processor.stripe.privatekey',
+ oils_i18n_gettext('credit.processor.stripe.secretkey',
'Stripe secret key',
'coust', 'description'),
'string', null)
--- /dev/null
+BEGIN;
+
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+
+-- cheat sheet for enabling Stripe payments:
+-- 'credit.payments.allow' must be true, and among other things it drives the
+-- opac to render a payment form at all
+-- NEW 'credit.processor.stripe.enabled' must be true (kind of redundant but
+-- my fault for setting the precedent with c.p.{authorizenet|paypal|payflowpro}.enabled)
+-- 'credit.default.processor' must be 'Stripe'
+-- NEW 'credit.processor.stripe.pubkey' must be set
+-- NEW 'credit.processor.stripe.secretkey' must be set
+
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class ) VALUES
+
+ ( 'credit.processor.stripe.enabled', 'credit',
+ oils_i18n_gettext('credit.processor.stripe.enabled',
+ 'Enable Stripe payments',
+ 'coust', 'label'),
+ oils_i18n_gettext('credit.processor.stripe.enabled',
+ 'Enable Stripe payments',
+ 'coust', 'description'),
+ 'bool', null)
+
+,( 'credit.processor.stripe.pubkey', 'credit',
+ oils_i18n_gettext('credit.processor.stripe.pubkey',
+ 'Stripe publishable key',
+ 'coust', 'label'),
+ oils_i18n_gettext('credit.processor.stripe.pubkey',
+ 'Stripe publishable key',
+ 'coust', 'description'),
+ 'string', null)
+
+,( 'credit.processor.stripe.secretkey', 'credit',
+ oils_i18n_gettext('credit.processor.stripe.secretkey',
+ 'Stripe secret key',
+ 'coust', 'label'),
+ oils_i18n_gettext('credit.processor.stripe.secretkey',
+ 'Stripe secret key',
+ 'coust', 'description'),
+ 'string', null)
+;
+
+UPDATE config.org_unit_setting_type
+SET description = 'This might be "AuthorizeNet", "PayPal", "PayflowPro", or "Stripe".'
+WHERE name = 'credit.processor.default' AND description = 'This might be "AuthorizeNet", "PayPal", etc.'; -- don't clobber local edits or i18n
+
+COMMIT;
myopac_main_page = "payment_form";
last_chance = CGI.param("last_chance");
- use_stripe = ctx.get_org_setting(ctx.user.home_ou.id, 'opac.processor.stripe.enabled');
%]
<h3 class="sr-only">[% l('Pay Fines') %]</h3>
[% IF ctx.fines.balance_owed <= 0 %]
<form method="post" id="payment_form"
[% IF use_stripe %]
onsubmit="return stripe_onsubmit();"
- [% ENDIF %]
+ [% END %]
>
<input type="hidden" name="last_chance" value="1" />
[% FOR xact IN CGI.param('xact') %]
[% END %]
[% IF use_stripe %]
<input type="hidden" name="stripe_token" id="stripe_token" />
- [% ENDIF %]
+ [% END %]
<table title="[% l('Billing Information') %]">
<tbody>
data-stripe="number"
[% ELSE %]
name="number"
- [% ENDIF %]
+ [% END %]
/></td>
</tr>
<tr>
data-stripe="cvc"
[% ELSE %]
name="cvv2"
- [% ENDIF %]
+ [% END %]
/></td>
</tr>
<tr>
data-stripe="exp_month"
[% ELSE %]
name="expire_month"
- [% END IF %]
+ [% END %]
>
<option value="01">[% l("January") %]</option>
<option value="02">[% l("February") %]</option>
data-stripe="exp_year"
[% ELSE %]
name="expire_year"
- [% ENDIF %]
+ [% END %]
>
[% year = date.format(date.now, '%Y');
y = year;