import { Component, Inject, OnInit } from '@angular/core';
import { GetPaymentMethod } from '../../../../../interfaces/payment-method.interface';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';

@Component({
    selector: 'app-payment-methods-provider',
    templateUrl: './payment-methods-provider.component.html',
    styleUrl: './payment-methods-provider.component.css',
    standalone: false
})
export class PaymentMethodsProviderComponent implements OnInit {
  public arrPayment: GetPaymentMethod[];
  constructor( 
    @Inject(MAT_DIALOG_DATA) public paymentMethod: GetPaymentMethod,
  ) {    
    this.arrPayment = [];
  }
  
  async ngOnInit() {
    for (const [key, value] of Object.entries(this.paymentMethod)) {      
      this.arrPayment.push({
        C_FORMAPAGO: key,
        DESCRIPCION: value
      });
    }
  }
}
