@opexa/portal-sdk 0.34.2 → 0.34.4

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/dist/index.cjs CHANGED
@@ -562,6 +562,36 @@ var CREATE_GCASH_DEPOSIT_MUTATION = gql`
562
562
  }
563
563
  }
564
564
  `;
565
+ var CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT_MUTATION = gql`
566
+ mutation CreateGCashDirectWebpayDeposit($input: CreateGCashDirectWebpayDepositInput!) {
567
+ createGCashDirectWebpayDeposit(input: $input) {
568
+ ... on DepositPromoMaximumAmountExceededError {
569
+ __typename
570
+ }
571
+ ... on DepositPromoMinimumAmountNotMetError {
572
+ __typename
573
+ }
574
+ ... on MaximumDepositAmountExceededError {
575
+ __typename
576
+ }
577
+ ... on MinimumDepositAmountNotMetError {
578
+ __typename
579
+ }
580
+ ... on MinimumFirstDepositAmountNotMetError {
581
+ __typename
582
+ }
583
+ ... on PromoNotEnabledError {
584
+ __typename
585
+ }
586
+ ... on WalletDoesNotExistError {
587
+ __typename
588
+ }
589
+ ... on GCashDirectApiRequestError {
590
+ __typename
591
+ }
592
+ }
593
+ }
594
+ `;
565
595
  var CREATE_MAYA_DEPOSIT_MUTATION = gql`
566
596
  mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
567
597
  createMayaDeposit(input: $input) {
@@ -1219,12 +1249,14 @@ var REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION = gql`
1219
1249
  $referralCode: String
1220
1250
  $reCAPTCHAResponse: String
1221
1251
  $verificationCode: String
1252
+ $testPass: String
1222
1253
  ) {
1223
1254
  registerMemberAccountViaMobile(
1224
1255
  input: $input
1225
1256
  referralCode: $referralCode
1226
1257
  verificationCode: $verificationCode
1227
1258
  reCAPTCHAResponse: $reCAPTCHAResponse
1259
+ testPass: $testPass
1228
1260
  ) {
1229
1261
  ... on InvalidPlatformError {
1230
1262
  __typename
@@ -2139,11 +2171,14 @@ var AccountService = class {
2139
2171
  };
2140
2172
  }
2141
2173
  async registerMemberAccountViaMobile(variables) {
2142
- const { reCAPTCHAResponse, ...others } = variables;
2174
+ const { reCAPTCHAResponse, testPass, ...others } = variables;
2143
2175
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION, others, {
2144
2176
  headers: {
2145
2177
  ...reCAPTCHAResponse && {
2146
2178
  "google-recaptcha-response": reCAPTCHAResponse
2179
+ },
2180
+ ...testPass && {
2181
+ "test-pass": "true"
2147
2182
  }
2148
2183
  }
2149
2184
  });
@@ -2371,7 +2406,7 @@ var AccountService = class {
2371
2406
  "google-recaptcha-response": reCAPTCHAResponse
2372
2407
  },
2373
2408
  ...variables.testPass && {
2374
- "Test-Pass": "true"
2409
+ "test-pass": "true"
2375
2410
  }
2376
2411
  }
2377
2412
  });
@@ -3358,6 +3393,26 @@ var WalletService = class {
3358
3393
  ok: true
3359
3394
  };
3360
3395
  }
3396
+ async createGCashDirectWebpayDeposit(variables) {
3397
+ const { reCAPTCHAResponse, ...others } = variables;
3398
+ const res = await this.client.request(CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT_MUTATION, others, {
3399
+ headers: {
3400
+ ...reCAPTCHAResponse && {
3401
+ "google-recaptcha-response": reCAPTCHAResponse
3402
+ }
3403
+ }
3404
+ });
3405
+ if (!res.ok) return res;
3406
+ if (res.data.createGCashDirectWebpayDeposit) {
3407
+ return {
3408
+ ok: false,
3409
+ error: createOperationError(res.data.createGCashDirectWebpayDeposit.__typename)
3410
+ };
3411
+ }
3412
+ return {
3413
+ ok: true
3414
+ };
3415
+ }
3361
3416
  async createMayaDeposit(variables) {
3362
3417
  const { reCAPTCHAResponse, ...others } = variables;
3363
3418
  const res = await this.client.request(CREATE_MAYA_DEPOSIT_MUTATION, others, {
@@ -5908,7 +5963,8 @@ var Sdk = class {
5908
5963
  },
5909
5964
  referralCode: input.referralCode,
5910
5965
  verificationCode: input.verificationCode,
5911
- reCAPTCHAResponse: input.reCAPTCHAResponse
5966
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
5967
+ testPass: input.testPass
5912
5968
  });
5913
5969
  return res2.ok ? { ok: true, data: { id } } : res2;
5914
5970
  }
@@ -6311,6 +6367,17 @@ var Sdk = class {
6311
6367
  });
6312
6368
  if (!res.ok) return res;
6313
6369
  }
6370
+ if (input.type === "GCASH_DIRECT_WEBPAY") {
6371
+ const res = await this.walletService.createGCashDirectWebpayDeposit({
6372
+ input: {
6373
+ id,
6374
+ amount: input.amount.toString(),
6375
+ promo: input.promo
6376
+ },
6377
+ reCAPTCHAResponse: input.reCAPTCHAResponse
6378
+ });
6379
+ if (!res.ok) return res;
6380
+ }
6314
6381
  return { ok: true, data: { id } };
6315
6382
  }
6316
6383
  async deposit(id) {