payrex-node 0.1.4 → 0.1.6
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 +9 -0
- package/package.json +1 -1
- package/src/HttpClient.js +7 -1
- package/src/entities/CheckoutSessionEntity.js +5 -3
- package/src/entities/MerchantEntity.js +0 -1
- package/src/entities/PaymentIntentEntity.js +0 -1
- package/src/entities/PaymentMethodEntity.js +0 -1
- package/src/entities/RefundEntity.js +0 -1
- package/src/entities/WebhookEntity.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.6] - 2024-07-24
|
|
4
|
+
|
|
5
|
+
- Adjust building of parameter query due to changes in checkout session endpoints.
|
|
6
|
+
|
|
7
|
+
## [0.1.5] - 2024-07-24
|
|
8
|
+
|
|
9
|
+
- Finalize the checkout session endpoints.
|
|
10
|
+
- Remove the resource attribute from all resources. This is the standard implementation across all PayRex SDKs.
|
|
11
|
+
|
|
3
12
|
## [0.1.4] - 2024-07-23
|
|
4
13
|
|
|
5
14
|
- Move the deprecated capture_type attribute.
|
package/package.json
CHANGED
package/src/HttpClient.js
CHANGED
|
@@ -25,8 +25,14 @@ HttpClient.prototype.request = async function ({ path, method, payload }) {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
let data = null;
|
|
28
|
+
|
|
28
29
|
if (method === 'post' || method === 'put') {
|
|
29
|
-
data = qs.stringify(
|
|
30
|
+
data = qs.stringify(
|
|
31
|
+
payload,
|
|
32
|
+
{
|
|
33
|
+
arrayFormat: 'brackets'
|
|
34
|
+
}
|
|
35
|
+
);
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
try {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
const PaymentIntentEntity = require("./PaymentIntentEntity");
|
|
2
|
+
|
|
1
3
|
function CheckoutSessionEntity(apiResource) {
|
|
2
4
|
const data = apiResource.data;
|
|
3
5
|
|
|
4
6
|
this.id = data.id;
|
|
5
|
-
this.resource = data.resource;
|
|
6
7
|
this.customerReferenceId = data.customer_reference_id;
|
|
7
8
|
this.clientSecret = data.client_secret;
|
|
8
9
|
this.status = data.status;
|
|
@@ -10,12 +11,13 @@ function CheckoutSessionEntity(apiResource) {
|
|
|
10
11
|
this.lineItems = data.line_items;
|
|
11
12
|
this.livemode = data.livemode;
|
|
12
13
|
this.url = data.url;
|
|
13
|
-
this.paymentIntent =
|
|
14
|
+
this.paymentIntent = new PaymentIntentEntity({
|
|
15
|
+
data: data.payment_intent
|
|
16
|
+
});
|
|
14
17
|
this.metadata = data.metadata;
|
|
15
18
|
this.successUrl = data.success_url;
|
|
16
19
|
this.cancelUrl = data.cancel_url;
|
|
17
20
|
this.paymentMethods = data.payment_methods;
|
|
18
|
-
this.captureType = data.capture_type;
|
|
19
21
|
this.description = data.description;
|
|
20
22
|
this.submitType = data.submit_type;
|
|
21
23
|
this.expiresAt = data.expires_at;
|