Skip to content

Commit b27f8f2

Browse files
author
Artem
committed
Change arrow functions to standard ones
1 parent a8ee393 commit b27f8f2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/utils/apple-pay-helpers.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const parseAmount = (amount: string): number => {
1212

1313
// @method shippingAddressToPayload(contact: Object, api: Object)
1414
// Parses the data sent from Apple into the server-accepted format
15-
export const shippingAddressToPayload = (contact: Object, api: Object): Promise<*> => {
15+
export function shippingAddressToPayload(contact: Object, api: Object): Promise<*> {
1616
return new Promise((resolve, reject) => {
1717
const { givenName, familyName, addressLines, locality, postalCode, phoneNumber, administrativeArea } = contact;
1818

@@ -42,11 +42,11 @@ export const shippingAddressToPayload = (contact: Object, api: Object): Promise<
4242
reject(err);
4343
});
4444
});
45-
};
45+
}
4646

4747
// @method shippingMethodsToPayload(methods: Array<Object>)
4848
// Parses the server-sent shipping methods into Apple format payload
49-
export const shippingMethodsToPayload = (methods: Array<Object>): Array<Object> => {
49+
export function shippingMethodsToPayload(methods: Array<Object>): Array<Object> {
5050
return _.map(methods, (method) => {
5151
return {
5252
label: method.code,
@@ -55,11 +55,11 @@ export const shippingMethodsToPayload = (methods: Array<Object>): Array<Object>
5555
identifier: method.id,
5656
};
5757
});
58-
};
58+
}
5959

6060
// @methods getLineItems(lineItems: Object, shippingCost: Number)
6161
// Parses additional costs into Apple accepted format
62-
export const getLineItems = (lineItems: Object, shippingCost: string): Array<Object> => {
62+
export function getLineItems(lineItems: Object, shippingCost: string): Array<Object> {
6363
const { taxes, promotion } = lineItems;
6464
const items = [
6565
{
@@ -86,15 +86,15 @@ export const getLineItems = (lineItems: Object, shippingCost: string): Array<Obj
8686
}
8787

8888
return items;
89-
};
89+
}
9090

9191
// @method failurePayload(paymentRequest: Object, status: Number, isShippingMethod: Boolean)
9292
// Assembles the correct payload to send to the callback function when payment fails
93-
export const failurePayload = (
93+
export function failurePayload(
9494
paymentRequest: Object,
9595
status: number,
9696
isShippingMethod: boolean = false
97-
): Array<mixed> => {
97+
): Array<mixed> {
9898
if (isShippingMethod) {
9999
return [
100100
status,
@@ -115,4 +115,4 @@ export const failurePayload = (
115115
},
116116
[],
117117
];
118-
};
118+
}

0 commit comments

Comments
 (0)