@opexa/portal-sdk 0.41.1 → 0.41.2
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/README.md +9 -0
- package/dist/index.cjs +68 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -586,6 +586,14 @@ function Page() {
|
|
|
586
586
|
recipientMobileNumber: string;
|
|
587
587
|
}
|
|
588
588
|
|
|
589
|
+
interface CreateGCashStandardCashInWithdrawalInput {
|
|
590
|
+
id?: string;
|
|
591
|
+
type: 'GCASH_STANDARD_CASHIN';
|
|
592
|
+
amount: number;
|
|
593
|
+
transactionPassword: string;
|
|
594
|
+
recipientMobileNumber: string;
|
|
595
|
+
}
|
|
596
|
+
|
|
589
597
|
interface CreateMayaWithdrawalInput {
|
|
590
598
|
id?: string;
|
|
591
599
|
type: 'MAYA';
|
|
@@ -604,6 +612,7 @@ function Page() {
|
|
|
604
612
|
type CreateWithdrawalInput =
|
|
605
613
|
| CreateBankWithdrawalInput
|
|
606
614
|
| CreateGCashWithdrawalInput
|
|
615
|
+
| CreateGCashStandardCashInWithdrawalInput
|
|
607
616
|
| CreateMayaWithdrawalInput
|
|
608
617
|
| CreateMayaAppWithdrawalInput;
|
|
609
618
|
|
package/dist/index.cjs
CHANGED
|
@@ -403,6 +403,39 @@ var CREATE_GCASH_WITHDRAWAL_MUTATION = gql`
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
`;
|
|
406
|
+
var CREATE_GCASH_STANDARD_CASHIN_WITHDRAWAL_MUTATION = gql`
|
|
407
|
+
mutation CreateGCashStandardCashInWithdrawal($input: CreateGCashStandardCashInWithdrawalInput!) {
|
|
408
|
+
createGCashStandardCashInWithdrawal(input: $input) {
|
|
409
|
+
... on AccountNotVerifiedError {
|
|
410
|
+
__typename
|
|
411
|
+
}
|
|
412
|
+
... on InvalidTransactionPasswordError {
|
|
413
|
+
__typename
|
|
414
|
+
}
|
|
415
|
+
... on InvalidWithdrawalAmountError {
|
|
416
|
+
__typename
|
|
417
|
+
}
|
|
418
|
+
... on MobileNumberNotVerifiedError {
|
|
419
|
+
__typename
|
|
420
|
+
}
|
|
421
|
+
... on NotEnoughBalanceError {
|
|
422
|
+
__typename
|
|
423
|
+
}
|
|
424
|
+
... on WithdrawalDailyLimitExceededError {
|
|
425
|
+
__typename
|
|
426
|
+
}
|
|
427
|
+
... on ReCAPTCHAVerificationFailedError {
|
|
428
|
+
__typename
|
|
429
|
+
}
|
|
430
|
+
... on WalletDoesNotExistError {
|
|
431
|
+
__typename
|
|
432
|
+
}
|
|
433
|
+
... on TransactionPasswordNotSetError {
|
|
434
|
+
__typename
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
`;
|
|
406
439
|
var CREATE_MAYA_WITHDRAWAL_MUTATION = gql`
|
|
407
440
|
mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
|
|
408
441
|
createMayaWithdrawal(input: $input) {
|
|
@@ -4131,6 +4164,26 @@ var WalletService = class {
|
|
|
4131
4164
|
ok: true
|
|
4132
4165
|
};
|
|
4133
4166
|
}
|
|
4167
|
+
async createGCashStandardCashInWithdrawal(variables) {
|
|
4168
|
+
const { reCAPTCHAResponse, ...others } = variables;
|
|
4169
|
+
const res = await this.client.request(CREATE_GCASH_STANDARD_CASHIN_WITHDRAWAL_MUTATION, others, {
|
|
4170
|
+
headers: {
|
|
4171
|
+
...reCAPTCHAResponse && {
|
|
4172
|
+
"google-recaptcha-response": reCAPTCHAResponse
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
});
|
|
4176
|
+
if (!res.ok) return res;
|
|
4177
|
+
if (res.data.createGCashStandardCashInWithdrawal) {
|
|
4178
|
+
return {
|
|
4179
|
+
ok: false,
|
|
4180
|
+
error: createOperationError(res.data.createGCashStandardCashInWithdrawal.__typename)
|
|
4181
|
+
};
|
|
4182
|
+
}
|
|
4183
|
+
return {
|
|
4184
|
+
ok: true
|
|
4185
|
+
};
|
|
4186
|
+
}
|
|
4134
4187
|
async createMayaWithdrawal(variables) {
|
|
4135
4188
|
const { reCAPTCHAResponse, ...others } = variables;
|
|
4136
4189
|
const res = await this.client.request(CREATE_MAYA_WITHDRAWAL_MUTATION, others, {
|
|
@@ -7707,6 +7760,21 @@ var Sdk = class {
|
|
|
7707
7760
|
});
|
|
7708
7761
|
if (!res.ok) return res;
|
|
7709
7762
|
}
|
|
7763
|
+
if (input.type === "GCASH_STANDARD_CASHIN") {
|
|
7764
|
+
const res = await this.walletService.createGCashStandardCashInWithdrawal({
|
|
7765
|
+
input: {
|
|
7766
|
+
id,
|
|
7767
|
+
amount: input.amount.toString(),
|
|
7768
|
+
transactionPassword: await sha256(input.transactionPassword),
|
|
7769
|
+
recipientMobileNumber: addAreaCode(
|
|
7770
|
+
input.recipientMobileNumber,
|
|
7771
|
+
await this.locale
|
|
7772
|
+
)
|
|
7773
|
+
},
|
|
7774
|
+
reCAPTCHAResponse: input.reCAPTCHAResponse
|
|
7775
|
+
});
|
|
7776
|
+
if (!res.ok) return res;
|
|
7777
|
+
}
|
|
7710
7778
|
if (input.type === "MAYA") {
|
|
7711
7779
|
const res = await this.walletService.createMayaWithdrawal({
|
|
7712
7780
|
input: {
|