payrex-node 0.1.1 → 0.1.3
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/HttpClient.js
CHANGED
|
@@ -40,11 +40,15 @@ HttpClient.prototype.request = async function ({ path, method, payload }) {
|
|
|
40
40
|
|
|
41
41
|
return new ApiResource(response.data);
|
|
42
42
|
} catch (error) {
|
|
43
|
+
if (error.response === undefined) {
|
|
44
|
+
throw new Error(error);
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
if (error.response.status === 400) {
|
|
44
48
|
throw new RequestInvalidError(error.response.data);
|
|
45
|
-
} else if (error.status === 401) {
|
|
49
|
+
} else if (error.response.status === 401) {
|
|
46
50
|
throw new AuthenticationInvalidError(error.response.data);
|
|
47
|
-
} else if (error.status === 404) {
|
|
51
|
+
} else if (error.response.status === 404) {
|
|
48
52
|
throw new ResourceNotFoundError(error.response.data);
|
|
49
53
|
} else {
|
|
50
54
|
throw new BaseError(error.response.data);
|
|
@@ -13,6 +13,7 @@ function PaymentIntentEntity(apiResource) {
|
|
|
13
13
|
this.latestPayment = data.latest_payment;
|
|
14
14
|
this.paymentMethodId = data.payment_method_id;
|
|
15
15
|
this.paymentMethods = data.payment_methods;
|
|
16
|
+
this.paymentMethodOptions = data.payment_method_options;
|
|
16
17
|
this.status = data.status;
|
|
17
18
|
this.nextAction = data.next_action;
|
|
18
19
|
this.returnUrl = data.return_url;
|