Skip to content

Commit 4616fb7

Browse files
committed
chore: adjust ui of express payment methods in dc
1 parent 9bfd18b commit 4616fb7

4 files changed

Lines changed: 39 additions & 26 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "processout.js",
3-
"version": "1.8.4",
3+
"version": "1.8.5",
44
"description": "ProcessOut.js is a JavaScript library for ProcessOut's payment processing API.",
55
"scripts": {
66
"build:processout": "tsc -p src/processout && uglifyjs --compress --keep-fnames --ie8 dist/processout.js -o dist/processout.js",

src/dynamic-checkout/clients/apple-pay.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module ProcessOut {
1818
const applePayScript = document.createElement("script")
1919
applePayScript.src = applePaySdkUrl
2020
applePayScript.onload = () => {
21-
buttonContainer.innerHTML = `<apple-pay-button buttonstyle="black" type="plain" locale="en-US"></apple-pay-button>`
21+
buttonContainer.innerHTML = `<apple-pay-button buttonstyle="white-outline" type="plain" locale="en-US"></apple-pay-button>`
2222
this.initializeApplePay(invoiceData, buttonContainer, getViewContainer)
2323
}
2424

@@ -83,20 +83,19 @@ module ProcessOut {
8383
this.paymentConfig.invoiceId,
8484
this.paymentConfig.invoiceDetails.return_url || null,
8585
),
86-
(err) =>
86+
err =>
8787
DynamicCheckoutEventsUtils.dispatchApplePaySessionError(
8888
this.paymentConfig.invoiceId,
8989
err,
9090
this.paymentConfig.invoiceDetails.return_url || null,
9191
),
9292
)
9393

94-
session.onpaymentauthorizedPostprocess =
95-
() =>
96-
DynamicCheckoutEventsUtils.dispatchApplePayAuthorizedPostProcessEvent(
97-
this.paymentConfig.invoiceId,
98-
this.paymentConfig.invoiceDetails.return_url || null,
99-
)
94+
session.onpaymentauthorizedPostprocess = () =>
95+
DynamicCheckoutEventsUtils.dispatchApplePayAuthorizedPostProcessEvent(
96+
this.paymentConfig.invoiceId,
97+
this.paymentConfig.invoiceDetails.return_url || null,
98+
)
10099

101100
return session
102101
}
@@ -197,7 +196,8 @@ module ProcessOut {
197196
invoiceId => {
198197
if (this.paymentConfig.showStatusMessage) {
199198
getViewContainer().appendChild(
200-
new DynamicCheckoutPaymentPendingView(this.processOutInstance, this.paymentConfig).element,
199+
new DynamicCheckoutPaymentPendingView(this.processOutInstance, this.paymentConfig)
200+
.element,
201201
)
202202
}
203203

src/dynamic-checkout/clients/google-pay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module ProcessOut {
9393
.then(response => {
9494
if (response.result) {
9595
const button = this.googleClient.createButton({
96-
buttonColor: "default",
96+
buttonColor: "white",
9797
buttonType: "plain",
9898
buttonRadius: 4,
9999
buttonSizeMode: "fill",

src/dynamic-checkout/styles/default.ts

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const defaultStyles = `
110110
111111
apple-pay-button {
112112
--apple-pay-button-width: 100%;
113-
--apple-pay-button-height: 40px;
113+
--apple-pay-button-height: 48px;
114114
--apple-pay-button-border-radius: 4px;
115115
--apple-pay-button-padding: 5px;
116116
--apple-pay-button-box-sizing: border-box;
@@ -153,14 +153,14 @@ const defaultStyles = `
153153
display: flex;
154154
flex-direction: column;
155155
align-items: flex-start;
156-
gap: 20px;
156+
gap: 10px;
157157
}
158158
159159
.dco-saved-payment-methods-wrapper {
160160
width: 100%;
161161
display: flex;
162162
flex-direction: column;
163-
gap: 8px;
163+
gap: 10px;
164164
}
165165
166166
.dco-saved-payment-method-button {
@@ -169,19 +169,15 @@ const defaultStyles = `
169169
justify-content: center;
170170
gap: 10px;
171171
width: 100%;
172-
padding: 12px 16px;
173-
border: 1px solid #dde0e3;
172+
height: 48px;
173+
padding: 0 16px;
174+
border: 1px solid #000;
174175
border-radius: 4px;
175-
background-color: #fff;
176+
background-color: transparent;
176177
cursor: pointer;
177178
font-weight: 500;
178179
font-size: 0.9rem;
179180
font-family: inherit;
180-
transition: background-color 0.2s;
181-
}
182-
183-
.dco-saved-payment-method-button:hover {
184-
background-color: #F6F6F7;
185181
}
186182
187183
.dco-saved-payment-method-button:disabled {
@@ -210,12 +206,28 @@ const defaultStyles = `
210206
211207
.dco-wallet-checkout-wrapper {
212208
display: flex;
209+
flex-direction: column;
213210
width: 100%;
214211
gap: 10px;
215212
}
216213
217214
.dco-wallet-checkout-button {
218-
flex: 1;
215+
width: 100%;
216+
}
217+
218+
#google-pay-button-container {
219+
height: 48px;
220+
}
221+
222+
#google-pay-button-container button {
223+
border: 1px solid #000 !important;
224+
border-radius: 4px !important;
225+
outline: none !important;
226+
background-color: #fff !important;
227+
}
228+
229+
#google-pay-button-container button:hover {
230+
background-color: #fff !important;
219231
}
220232
221233
.dco-regular-express-checkout-wrapper {
@@ -238,7 +250,7 @@ const defaultStyles = `
238250
display: flex;
239251
flex-direction: column;
240252
border: 1px solid #dde0e3;
241-
border-radius: 4px;
253+
border-radius: 12px;
242254
overflow: hidden;
243255
}
244256
@@ -472,8 +484,8 @@ const defaultStyles = `
472484
.dco-payment-method-button-pay-button-spinner {
473485
width: 18px;
474486
height: 18px;
475-
border: 3px solid #f2f2f2;
476-
border-bottom-color: #bfbfbf;
487+
border: 3px solid #ccc;
488+
border-bottom-color: #333;
477489
border-radius: 50%;
478490
display: inline-block;
479491
box-sizing: border-box;
@@ -592,6 +604,7 @@ const defaultStyles = `
592604
width: 100%;
593605
align-items: center;
594606
justify-content: space-between;
607+
margin-bottom: 10px;
595608
}
596609
597610
.modal-box {

0 commit comments

Comments
 (0)