@paypal/checkout-components 5.0.295-alpha.201 → 5.0.295
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -127,9 +127,6 @@ export const buildHostedButtonCreateOrder = ({
|
|
|
127
127
|
...userInputs,
|
|
128
128
|
}),
|
|
129
129
|
}).then(({ body }) => {
|
|
130
|
-
if (!body.context_id) {
|
|
131
|
-
window[`__pp_form_fields_${hostedButtonId}`]?.onError?.(body.name);
|
|
132
|
-
}
|
|
133
130
|
return body.context_id;
|
|
134
131
|
});
|
|
135
132
|
});
|
|
@@ -101,31 +101,6 @@ test("buildHostedButtonCreateOrder", async () => {
|
|
|
101
101
|
expect.assertions(1);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
test("buildHostedButtonCreateOrder error handling", async () => {
|
|
105
|
-
const createOrder = buildHostedButtonCreateOrder({
|
|
106
|
-
hostedButtonId,
|
|
107
|
-
merchantId,
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// $FlowIssue
|
|
111
|
-
request.mockImplementation(() =>
|
|
112
|
-
ZalgoPromise.resolve({
|
|
113
|
-
body: {
|
|
114
|
-
name: "RESOURCE_NOT_FOUND",
|
|
115
|
-
},
|
|
116
|
-
})
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
const onError = vi.fn();
|
|
120
|
-
window[`__pp_form_fields_${hostedButtonId}`] = {
|
|
121
|
-
onError,
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
await createOrder({ paymentSource: "paypal" });
|
|
125
|
-
expect(onError).toHaveBeenCalledWith("RESOURCE_NOT_FOUND");
|
|
126
|
-
expect.assertions(1);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
104
|
describe("buildHostedButtonOnApprove", () => {
|
|
130
105
|
test("makes a request to the Hosted Buttons API", async () => {
|
|
131
106
|
const onApprove = buildHostedButtonOnApprove({
|