Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit } from '@angular/core';
  2.   import { PaiementService } from 'app/service/paiement.service';
  3.  
  4. @Component({
  5.   selector: 'app-paiement-en-ligne',
  6.   templateUrl: './paiement-en-ligne.component.html',
  7.   styleUrls: ['./paiement-en-ligne.component.scss']
  8. })
  9. export class PaiementEnLigneComponent implements OnInit {
  10.  
  11.  
  12.   clientid="600001032";
  13.   storetype="3d_pay_hosting";
  14.   hash;
  15.   trantype="PreAuth";
  16.   amount="17777.05";
  17.   currency="504";
  18.   oid="84946";
  19.   okUrl="http://localhost:8080/api/paiementenligne/ok-fails";
  20.   failUrl="http://localhost:8080/api/paiementenligne/ok-fails";
  21.   lang="fr";
  22.   rnd="asdf";
  23.   hashAlgorithm="ver3";
  24.   email="test@test.com";
  25.   BillToName="HAMZA AIT OUMGHAR";
  26.   encoding="utf-8";
  27.   tel="0623422371";
  28.   BillToStreet1="test test";
  29.   CallbackURL="https://capmission-paiement.herokuapp.com/api/paiementenligne/callback";
  30.   CallbackResponse=true;
  31.  
  32.   constructor(private paiementService:PaiementService) {
  33.   }
  34.  
  35.   ngOnInit() {
  36.  
  37.   }
  38.  
  39.   payer(form){
  40.     let data = {
  41.       "clientid":form.clientid.value,
  42.       "storetype":form.storetype.value,
  43.       "trantype":form.trantype.value,
  44.       "amount":form.amount.value,
  45.       "currency":form.currency.value,
  46.       "oid":form.oid.value,
  47.       "okUrl":form.okUrl.value,
  48.       "failUrl":form.failUrl.value,
  49.       "lang":form.lang.value,
  50.       "rnd":form.rnd.value,
  51.       "hashAlgorithm":form.hashAlgorithm.value,
  52.       "email":form.email.value,
  53.       "BillToName":form.BillToName.value,
  54.       "encoding":form.encoding.value,
  55.       "tel":form.tel.value,
  56.       "BillToStreet1":form.BillToStreet1.value,
  57.       "CallbackURL":form.CallbackURL.value
  58.     }
  59.     this.paiementService.testPaiementEnLigne(data).subscribe(
  60.       data=>{
  61.         form.hash.value=data;
  62.         form.submit();
  63.       },
  64.       err=>{
  65.         console.log(err);
  66.     });
  67.   }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement