Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions examples/dynamic-checkout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@

<label class="form-field">
<span>Pay Button Color</span>
<input
id="pay-button-color"
name="payButtonColor"
type="text"
value="#242c38"
/>
<input id="pay-button-color" name="payButtonColor" type="text" value="#242c38" />
</label>

<label class="form-field">
Expand Down Expand Up @@ -104,7 +99,7 @@
<label class="form-field form-field-toggle">
<input
id="enforce-safe-payment-method"
name="enforceSafePaymentMethod"
name="enforceSavePaymentMethod"
type="checkbox"
/>
<span>Enforce Safe Payment Method</span>
Expand Down Expand Up @@ -202,7 +197,7 @@ <h2>Dispatched Events</h2>
locale: formValues.locale,
capturePayments: formValues.capturePayments,
allowFallbackToSale: formValues.allowFallbackToSale,
enforceSafePaymentMethod: formValues.enforceSafePaymentMethod,
enforceSavePaymentMethod: formValues.enforceSavePaymentMethod,
hideSavedPaymentMethods: formValues.hideSavedPaymentMethods,
showStatusMessage: formValues.showStatusMessage,
payButtonText: formValues.payButtonText,
Expand Down Expand Up @@ -235,7 +230,7 @@ <h2>Dispatched Events</h2>
const payButtonTextColor = document.getElementById("pay-button-text-color").value.trim()
const capturePayments = document.getElementById("capture-payments").checked
const allowFallbackToSale = document.getElementById("allow-fallback-to-sale").checked
const enforceSafePaymentMethod = document.getElementById(
const enforceSavePaymentMethod = document.getElementById(
"enforce-safe-payment-method",
).checked
const hideSavedPaymentMethods = document.getElementById(
Expand All @@ -251,7 +246,7 @@ <h2>Dispatched Events</h2>
locale,
capturePayments,
allowFallbackToSale,
enforceSafePaymentMethod,
enforceSavePaymentMethod,
hideSavedPaymentMethods,
showStatusMessage,
payButtonText,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "processout.js",
"version": "1.8.2",
"version": "1.8.3",
"description": "ProcessOut.js is a JavaScript library for ProcessOut's payment processing API.",
"scripts": {
"build:processout": "tsc -p src/processout && uglifyjs --compress --keep-fnames --ie8 dist/processout.js -o dist/processout.js",
Expand Down
8 changes: 4 additions & 4 deletions src/dynamic-checkout/config/payment-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module ProcessOut {
clientSecret?: string
capturePayments?: boolean
allowFallbackToSale?: boolean
enforceSafePaymentMethod?: boolean
enforceSavePaymentMethod?: boolean
hideSavedPaymentMethods?: boolean
showStatusMessage?: boolean
payButtonText?: string
Expand All @@ -35,7 +35,7 @@ module ProcessOut {
locale: DynamicCheckoutPublicConfigType["locale"] = "en"
capturePayments: DynamicCheckoutPublicConfigType["capturePayments"] = false
allowFallbackToSale: DynamicCheckoutPublicConfigType["allowFallbackToSale"] = false
enforceSafePaymentMethod: DynamicCheckoutPublicConfigType["enforceSafePaymentMethod"] = false
enforceSavePaymentMethod: DynamicCheckoutPublicConfigType["enforceSavePaymentMethod"] = false
hideSavedPaymentMethods: DynamicCheckoutPublicConfigType["hideSavedPaymentMethods"] = false
showStatusMessage: DynamicCheckoutPublicConfigType["showStatusMessage"] = true
payButtonText: DynamicCheckoutPublicConfigType["payButtonText"] = ""
Expand All @@ -56,7 +56,7 @@ module ProcessOut {
invoiceDetails: this.invoiceDetails,
capturePayments: this.capturePayments,
allowFallbackToSale: this.allowFallbackToSale,
enforceSafePaymentMethod: this.enforceSafePaymentMethod,
enforceSavePaymentMethod: this.enforceSavePaymentMethod,
hideSavedPaymentMethods: this.hideSavedPaymentMethods,
showStatusMessage: this.showStatusMessage,
additionalData: this.additionalData,
Expand Down Expand Up @@ -87,7 +87,7 @@ module ProcessOut {
this.locale = config.locale || "en"
this.capturePayments = config.capturePayments || false
this.allowFallbackToSale = config.allowFallbackToSale || false
this.enforceSafePaymentMethod = config.enforceSafePaymentMethod || false
this.enforceSavePaymentMethod = config.enforceSavePaymentMethod || false
this.hideSavedPaymentMethods = config.hideSavedPaymentMethods || false
this.payButtonText = config.payButtonText || ""
this.additionalData = config.additionalData || {}
Expand Down
6 changes: 3 additions & 3 deletions src/dynamic-checkout/payment-methods/apm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module ProcessOut {
const cardPaymentOptions = {
authorize_only: !this.paymentConfig.capturePayments,
allow_fallback_to_sale: this.paymentConfig.allowFallbackToSale,
save_source: canSavePaymentMethod && this.paymentConfig.enforceSafePaymentMethod,
save_source: canSavePaymentMethod && this.paymentConfig.enforceSavePaymentMethod,
}

const requestOptions = {
Expand All @@ -69,7 +69,7 @@ module ProcessOut {
if (
canSavePaymentMethod &&
saveForFutureCheckbox &&
!this.paymentConfig.enforceSafePaymentMethod
!this.paymentConfig.enforceSavePaymentMethod
) {
cardPaymentOptions["save_source"] = saveForFutureCheckbox.checked
}
Expand Down Expand Up @@ -407,7 +407,7 @@ module ProcessOut {
id: `save-apm-for-future-${this.paymentMethod.apm.gateway_name}`,
}

if (this.paymentConfig.enforceSafePaymentMethod) {
if (this.paymentConfig.enforceSavePaymentMethod) {
saveForFutureAttributes.checked = "checked"
saveForFutureAttributes.disabled = "disabled"
}
Expand Down
10 changes: 6 additions & 4 deletions src/dynamic-checkout/payment-methods/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module ProcessOut {
const cardPaymentOptions = {
authorize_only: !this.paymentConfig.capturePayments,
allow_fallback_to_sale: this.paymentConfig.allowFallbackToSale,
save_source: canSavePaymentMethod && this.paymentConfig.enforceSafePaymentMethod,
save_source: canSavePaymentMethod && this.paymentConfig.enforceSavePaymentMethod,
}

const saveForFutureCheckbox = document.getElementById(
Expand All @@ -136,7 +136,7 @@ module ProcessOut {
if (
canSavePaymentMethod &&
saveForFutureCheckbox &&
!this.paymentConfig.enforceSafePaymentMethod
!this.paymentConfig.enforceSavePaymentMethod
) {
cardPaymentOptions["save_source"] = saveForFutureCheckbox.checked
}
Expand Down Expand Up @@ -276,7 +276,7 @@ module ProcessOut {
name: "save-card-for-future",
}

if (this.paymentConfig.enforceSafePaymentMethod) {
if (this.paymentConfig.enforceSavePaymentMethod) {
saveForFutureAttributes.checked = "checked"
saveForFutureAttributes.disabled = "disabled"
}
Expand Down Expand Up @@ -364,7 +364,9 @@ module ProcessOut {
}

private getCvcLabel() {
return this.paymentConfig.cvcLabel || Translations.getText("cvc-label", this.paymentConfig.locale)
return (
this.paymentConfig.cvcLabel || Translations.getText("cvc-label", this.paymentConfig.locale)
)
}

private getCvcPlaceholder() {
Expand Down
Loading