@miden-npm/angular 0.0.17 → 0.0.18

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, EnvironmentProviders, EventEmitter, ElementRef, OnInit } from '@angular/core';
3
- import { ControlValueAccessor } from '@angular/forms';
3
+ import { ControlValueAccessor, AbstractControl, ValidatorFn } from '@angular/forms';
4
4
  import { HttpClient } from '@angular/common/http';
5
5
  import { Observable } from 'rxjs';
6
6
 
@@ -304,6 +304,7 @@ declare class IconArrowSwapComponent {
304
304
  }
305
305
 
306
306
  interface IPaymentObject {
307
+ merchantName: string;
307
308
  amount: number;
308
309
  currency: string;
309
310
  email: string;
@@ -311,6 +312,112 @@ interface IPaymentObject {
311
312
  narration: string;
312
313
  redirectUrl: string;
313
314
  }
315
+ interface ICardDetails {
316
+ pan: string;
317
+ expiryDate: string;
318
+ cvv: string;
319
+ cardScheme?: string;
320
+ nameOnCard: string;
321
+ pin?: string;
322
+ }
323
+ interface IBillingDetails {
324
+ address2?: string;
325
+ address1: string;
326
+ postalCode: string;
327
+ state: string;
328
+ city: string;
329
+ country: string;
330
+ emailAddress: string;
331
+ phoneNumber: string;
332
+ }
333
+ interface IAuthorizeCardPaymentPayload {
334
+ customerId: string;
335
+ amount: string;
336
+ currency: string;
337
+ narration: string;
338
+ encryptedCardDetails: string;
339
+ billingDetails: IBillingDetails;
340
+ redirectUrl: string;
341
+ paymentReference: string;
342
+ isCheckout: boolean;
343
+ }
344
+ interface ICheckoutApiResponse {
345
+ transactionReference: string | null;
346
+ amount: string | null;
347
+ transactionId: string | null;
348
+ plainTextSupportMessage: string | null;
349
+ jwt: string | null;
350
+ md: string | null;
351
+ acsUrl: string | null;
352
+ termUrl: string | null;
353
+ eciFlag: string | null;
354
+ provider: string;
355
+ requires3DS: boolean;
356
+ isSuccessful: boolean;
357
+ responseMessage: string;
358
+ responseCode: string;
359
+ data: string | null;
360
+ }
361
+ interface IGeneratePaymentAccountPayload {
362
+ paymentReference: string;
363
+ channel: string;
364
+ customerName: string;
365
+ merchantId: string;
366
+ }
367
+ interface IPaymentAccountResponse {
368
+ accountName: string;
369
+ accountNumber: string;
370
+ bank: string;
371
+ }
372
+ interface IPaymentReferenceDetail {
373
+ id: string;
374
+ transactionReference: string;
375
+ customerName: string | null;
376
+ merchantName: string;
377
+ email: string | null;
378
+ phoneNumber: string | null;
379
+ amount: number;
380
+ currency: string;
381
+ merchantReference: string;
382
+ narration: string;
383
+ redirectUrl: string;
384
+ paymentStatus: string;
385
+ linkName: string;
386
+ type: string;
387
+ virtualAccountNumber: string | null;
388
+ ussdCode: string | null;
389
+ merchantId: string;
390
+ paymentUrl: string;
391
+ webhookUrl: string | null;
392
+ channel: string | null;
393
+ webhookProcessed: boolean;
394
+ webhookProcessingStatus: string | null;
395
+ webhookProcessingTime: string;
396
+ tryCount: number;
397
+ transactionDate: string;
398
+ finalTransactionStatus: string | null;
399
+ settledAmount: number;
400
+ transactionPosted: boolean;
401
+ postingTransactionId: string | null;
402
+ postedAmount: number;
403
+ createdAt: string;
404
+ updatedAt: string;
405
+ invoiceReceiptUrl: string;
406
+ invoiceUrl: string;
407
+ }
408
+ interface IGenerateStableCoinAddress {
409
+ paymentReference: string;
410
+ currency: string;
411
+ chain: string;
412
+ transactionAmount: number;
413
+ merchantId: string;
414
+ }
415
+ interface IGenerateStableCoinAddressResponse {
416
+ walletAddress: string;
417
+ transactionAmount: string;
418
+ chain: string;
419
+ networkFee: number;
420
+ }
314
421
 
315
422
  interface IPagination {
316
423
  currentPage?: number;
@@ -341,15 +448,55 @@ interface IApiResponse<T> extends IPagination {
341
448
  totalDebitTransactions?: string;
342
449
  totalTransactions?: string;
343
450
  }
451
+ interface ICountry {
452
+ countryName: string;
453
+ iso2: string;
454
+ iso3: string;
455
+ }
456
+ interface IState {
457
+ name: string;
458
+ code: string;
459
+ }
344
460
 
345
461
  declare class CheckoutService {
346
462
  private http;
347
463
  constructor(http: HttpClient);
464
+ billingInformation: any;
465
+ setBillingInfo(info: any): void;
348
466
  createPaymentLink(payload: IPaymentObject, environment: string, secretKey: string): Observable<IApiResponse<any>>;
467
+ generatePaymentAccount(environment: string, { merchantId, ...rest }: IGeneratePaymentAccountPayload): Observable<IApiResponse<IPaymentAccountResponse>>;
468
+ authorizeCardPayment(environment: string, { merchantId, ...rest }: IAuthorizeCardPaymentPayload & {
469
+ merchantId: string;
470
+ }): Observable<ICheckoutApiResponse>;
471
+ getPaymentReferenceDetails(environment: string, paymentReference: string): Observable<IApiResponse<IPaymentReferenceDetail>>;
472
+ generateStableCoinAddress(environment: string, { merchantId, ...rest }: IGenerateStableCoinAddress): Observable<IApiResponse<IGenerateStableCoinAddressResponse>>;
349
473
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutService, never>;
350
474
  static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutService>;
351
475
  }
352
476
 
477
+ declare class ResourceService {
478
+ private http;
479
+ constructor(http: HttpClient);
480
+ getCountries(environment: string, secretKey: string): Observable<IApiResponse<ICountry[]>>;
481
+ getCountryStates(countryIso3: string, environment: string, secretKey: string): Observable<IApiResponse<IState[]>>;
482
+ getStableCoins(environment: string): Observable<IApiResponse<{
483
+ name: string;
484
+ }[]>>;
485
+ getStableCoinNetworks(environment: string, stableCoin: string): Observable<IApiResponse<string[]>>;
486
+ static ɵfac: i0.ɵɵFactoryDeclaration<ResourceService, never>;
487
+ static ɵprov: i0.ɵɵInjectableDeclaration<ResourceService>;
488
+ }
489
+
490
+ declare class EncryptService {
491
+ constructor();
492
+ encryptPayload(environment: string, formData?: any): {
493
+ requestParam: string;
494
+ };
495
+ decryptPayload(environment: string, payload: string): any;
496
+ static ɵfac: i0.ɵɵFactoryDeclaration<EncryptService, never>;
497
+ static ɵprov: i0.ɵɵInjectableDeclaration<EncryptService>;
498
+ }
499
+
353
500
  declare const getBaseUrl: (mode: string) => string;
354
501
 
355
502
  declare const restrictToNumericKeys: (event: KeyboardEvent) => void;
@@ -360,5 +507,33 @@ declare const currencySign: (currency: string) => string;
360
507
  declare const formatAmount: (value: number | string, currency?: string) => string;
361
508
  declare const truncateString: (str: string, num: number) => string;
362
509
 
363
- export { BZP_CONFIG, BZP_CORRELATION_ID, BackComponent, ButtonComponent, CardComponent, CheckoutService, CopyComponent, CurrencyAmountComponent, HintComponent, IconArrowSwapComponent, IconBuzapayIconComponent, IconCheckCircleComponent, IconChevronDownComponent, IconChevronLeftComponent, IconChevronUpComponent, IconCopySuccessComponent, IconLoaderComponent, IconUsdcComponent, IconUsdtComponent, ImageComponent, InputComponent, InputErrorComponent, LabelInfoComponent, MidenPGAngular, RadioGroupComponent, SelectComponent, SuccessComponent, apiBaseUrl, checkObjectTruthy, currencySign, formatAmount, getBaseUrl, provideMidenPG, restrictToNumericKeys, truncateString };
364
- export type { BzpConfig, BzpEnvironment, IApiResponse, IPagination, IPaymentObject, ISelectOption };
510
+ declare function getValidationErrorMessage(control: AbstractControl | null, fieldLabel?: string): string | null;
511
+
512
+ declare const urlValidator: () => ValidatorFn;
513
+
514
+ declare enum CardSchemes {
515
+ Visa = 1,
516
+ MasterCard = 2,
517
+ Verve = 3,
518
+ MastercardAndVisa = 4,
519
+ AmericanExpress = 5,
520
+ Discover = 6,
521
+ JCB = 7,
522
+ DinersClub = 8,
523
+ Maestro = 9,
524
+ UnionPay = 10,
525
+ UnionPay3DS = 11,// based on known test BINs only
526
+ UnionPayNon3DS = 12,// based on known test BINs only
527
+ UATP = 13,
528
+ PayPak = 14,
529
+ Jaywan = 15,
530
+ Mada = 16,// mada-only
531
+ MadaVisa = 17,
532
+ MadaMastercard = 18,
533
+ Unknown = 19
534
+ }
535
+ declare function cardType(cardNumber: string): string;
536
+ declare function detect(cardNumber: string): CardSchemes;
537
+
538
+ export { BZP_CONFIG, BZP_CORRELATION_ID, BackComponent, ButtonComponent, CardComponent, CardSchemes, CheckoutService, CopyComponent, CurrencyAmountComponent, EncryptService, HintComponent, IconArrowSwapComponent, IconBuzapayIconComponent, IconCheckCircleComponent, IconChevronDownComponent, IconChevronLeftComponent, IconChevronUpComponent, IconCopySuccessComponent, IconLoaderComponent, IconUsdcComponent, IconUsdtComponent, ImageComponent, InputComponent, InputErrorComponent, LabelInfoComponent, MidenPGAngular, RadioGroupComponent, ResourceService, SelectComponent, SuccessComponent, apiBaseUrl, cardType, checkObjectTruthy, currencySign, detect, formatAmount, getBaseUrl, getValidationErrorMessage, provideMidenPG, restrictToNumericKeys, truncateString, urlValidator };
539
+ export type { BzpConfig, BzpEnvironment, IApiResponse, IAuthorizeCardPaymentPayload, IBillingDetails, ICardDetails, ICheckoutApiResponse, ICountry, IGeneratePaymentAccountPayload, IGenerateStableCoinAddress, IGenerateStableCoinAddressResponse, IPagination, IPaymentAccountResponse, IPaymentObject, IPaymentReferenceDetail, ISelectOption, IState };
package/package.json CHANGED
@@ -1,43 +1,53 @@
1
1
  {
2
2
  "name": "@miden-npm/angular",
3
- "private": false,
4
3
  "publishConfig": {
5
4
  "registry": "https://registry.npmjs.org",
6
5
  "access": "public"
7
6
  },
8
- "version": "0.0.17",
9
- "description": "Miden Payment Gateway Angular SDK",
10
- "keywords": [
11
- "payments",
12
- "miden-pg",
13
- "angular",
14
- "sdk"
15
- ],
16
- "sideEffects": false,
17
- "peerDependencies": {
18
- "@angular/common": "^20.2.0",
19
- "@angular/core": "^20.2.0"
20
- },
21
- "dependencies": {
22
- "tslib": "^2.3.0"
23
- },
7
+ "version": "0.0.18",
8
+ "main": "./fesm2022/miden-npm-angular.mjs",
24
9
  "module": "fesm2022/miden-npm-angular.mjs",
25
- "typings": "index.d.ts",
10
+ "types": "./index.d.ts",
26
11
  "exports": {
27
- "./package.json": {
28
- "default": "./package.json"
29
- },
30
12
  ".": {
13
+ "import": "./fesm2022/miden-npm-angular.mjs",
31
14
  "types": "./index.d.ts",
32
15
  "default": "./fesm2022/miden-npm-angular.mjs"
33
16
  },
34
17
  "./buzapay-checkout": {
18
+ "import": "./fesm2022/miden-npm-angular-buzapay-checkout.mjs",
35
19
  "types": "./buzapay-checkout/index.d.ts",
36
20
  "default": "./fesm2022/miden-npm-angular-buzapay-checkout.mjs"
37
21
  },
38
22
  "./testing": {
23
+ "import": "./fesm2022/miden-npm-angular-testing.mjs",
39
24
  "types": "./testing/index.d.ts",
40
25
  "default": "./fesm2022/miden-npm-angular-testing.mjs"
26
+ },
27
+ "./package.json": {
28
+ "default": "./package.json"
29
+ },
30
+ "./styles.css": {
31
+ "default": "./styles.css"
41
32
  }
42
- }
33
+ },
34
+ "description": "Miden Payment Gateway Angular SDK",
35
+ "keywords": [
36
+ "payments",
37
+ "miden-pg",
38
+ "angular",
39
+ "sdk"
40
+ ],
41
+ "sideEffects": false,
42
+ "peerDependencies": {
43
+ "@angular/common": "^20.2.0",
44
+ "@angular/core": "^20.2.0",
45
+ "angular-imask": "^7.6.1",
46
+ "crypto-js": "^4.2.0",
47
+ "imask": "^7.6.1"
48
+ },
49
+ "dependencies": {
50
+ "tslib": "^2.3.0"
51
+ },
52
+ "typings": "index.d.ts"
43
53
  }