@blocklet/payment-react 1.13.122 → 1.13.123
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/es/payment/form/index.js
CHANGED
|
@@ -10,12 +10,13 @@ import { PhoneNumberUtil } from "google-libphonenumber";
|
|
|
10
10
|
import pWaitFor from "p-wait-for";
|
|
11
11
|
import { useEffect, useState } from "react";
|
|
12
12
|
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
|
13
|
+
import { joinURL } from "ufo";
|
|
13
14
|
import { dispatch } from "use-bus";
|
|
14
15
|
import isEmail from "validator/es/lib/isEmail";
|
|
15
16
|
import api from "../../api.js";
|
|
16
17
|
import FormInput from "../../components/input.js";
|
|
17
18
|
import { usePaymentContext } from "../../contexts/payment.js";
|
|
18
|
-
import { formatError, getStatementDescriptor } from "../../util.js";
|
|
19
|
+
import { formatError, getPrefix, getStatementDescriptor } from "../../util.js";
|
|
19
20
|
import UserButtons from "./addon.js";
|
|
20
21
|
import AddressForm from "./address.js";
|
|
21
22
|
import PhoneInput from "./phone.js";
|
|
@@ -169,6 +170,7 @@ export default function PaymentForm({
|
|
|
169
170
|
} else {
|
|
170
171
|
connect.open({
|
|
171
172
|
action: checkoutSession.mode,
|
|
173
|
+
prefix: joinURL(getPrefix(), "/api/did"),
|
|
172
174
|
timeout: 5 * 60 * 1e3,
|
|
173
175
|
extraParams: { checkoutSessionId: checkoutSession.id },
|
|
174
176
|
onSuccess: async () => {
|
|
@@ -16,6 +16,7 @@ var _googleLibphonenumber = require("google-libphonenumber");
|
|
|
16
16
|
var _pWaitFor = _interopRequireDefault(require("p-wait-for"));
|
|
17
17
|
var _react = require("react");
|
|
18
18
|
var _reactHookForm = require("react-hook-form");
|
|
19
|
+
var _ufo = require("ufo");
|
|
19
20
|
var _useBus = require("use-bus");
|
|
20
21
|
var _isEmail = _interopRequireDefault(require("validator/es/lib/isEmail"));
|
|
21
22
|
var _api = _interopRequireDefault(require("../../api"));
|
|
@@ -204,6 +205,7 @@ function PaymentForm({
|
|
|
204
205
|
} else {
|
|
205
206
|
connect.open({
|
|
206
207
|
action: checkoutSession.mode,
|
|
208
|
+
prefix: (0, _ufo.joinURL)((0, _util.getPrefix)(), "/api/did"),
|
|
207
209
|
timeout: 5 * 60 * 1e3,
|
|
208
210
|
extraParams: {
|
|
209
211
|
checkoutSessionId: checkoutSession.id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.123",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@babel/core": "^7.19.3",
|
|
90
90
|
"@babel/preset-env": "^7.19.3",
|
|
91
91
|
"@babel/preset-react": "^7.18.6",
|
|
92
|
-
"@blocklet/payment-types": "1.13.
|
|
92
|
+
"@blocklet/payment-types": "1.13.123",
|
|
93
93
|
"@storybook/addon-essentials": "^7.6.10",
|
|
94
94
|
"@storybook/addon-interactions": "^7.6.10",
|
|
95
95
|
"@storybook/addon-links": "^7.6.10",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"vite-plugin-babel": "^1.2.0",
|
|
119
119
|
"vite-plugin-node-polyfills": "^0.19.0"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "ea37183dafcf5a89c0593886aa895b33eccf8529"
|
|
122
122
|
}
|
|
@@ -11,6 +11,7 @@ import { PhoneNumberUtil } from 'google-libphonenumber';
|
|
|
11
11
|
import pWaitFor from 'p-wait-for';
|
|
12
12
|
import { useEffect, useState } from 'react';
|
|
13
13
|
import { Controller, useFormContext, useWatch } from 'react-hook-form';
|
|
14
|
+
import { joinURL } from 'ufo';
|
|
14
15
|
import { dispatch } from 'use-bus';
|
|
15
16
|
import isEmail from 'validator/es/lib/isEmail';
|
|
16
17
|
|
|
@@ -18,7 +19,7 @@ import api from '../../api';
|
|
|
18
19
|
import FormInput from '../../components/input';
|
|
19
20
|
import { usePaymentContext } from '../../contexts/payment';
|
|
20
21
|
import { CheckoutCallbacks, CheckoutContext } from '../../types';
|
|
21
|
-
import { formatError, getStatementDescriptor } from '../../util';
|
|
22
|
+
import { formatError, getPrefix, getStatementDescriptor } from '../../util';
|
|
22
23
|
import UserButtons from './addon';
|
|
23
24
|
import AddressForm from './address';
|
|
24
25
|
import PhoneInput from './phone';
|
|
@@ -226,6 +227,7 @@ export default function PaymentForm({
|
|
|
226
227
|
} else {
|
|
227
228
|
connect.open({
|
|
228
229
|
action: checkoutSession.mode,
|
|
230
|
+
prefix: joinURL(getPrefix(), '/api/did'),
|
|
229
231
|
timeout: 5 * 60 * 1000,
|
|
230
232
|
extraParams: { checkoutSessionId: checkoutSession.id },
|
|
231
233
|
onSuccess: async () => {
|