Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import { PaiementService } from 'app/service/paiement.service';
- @Component({
- selector: 'app-paiement-en-ligne',
- templateUrl: './paiement-en-ligne.component.html',
- styleUrls: ['./paiement-en-ligne.component.scss']
- })
- export class PaiementEnLigneComponent implements OnInit {
- clientid="600001032";
- storetype="3d_pay_hosting";
- hash;
- trantype="PreAuth";
- amount="17777.05";
- currency="504";
- oid="84946";
- okUrl="http://localhost:8080/api/paiementenligne/ok-fails";
- failUrl="http://localhost:8080/api/paiementenligne/ok-fails";
- lang="fr";
- rnd="asdf";
- hashAlgorithm="ver3";
- email="test@test.com";
- BillToName="HAMZA AIT OUMGHAR";
- encoding="utf-8";
- tel="0623422371";
- BillToStreet1="test test";
- CallbackURL="https://capmission-paiement.herokuapp.com/api/paiementenligne/callback";
- CallbackResponse=true;
- constructor(private paiementService:PaiementService) {
- }
- ngOnInit() {
- }
- payer(form){
- let data = {
- "clientid":form.clientid.value,
- "storetype":form.storetype.value,
- "trantype":form.trantype.value,
- "amount":form.amount.value,
- "currency":form.currency.value,
- "oid":form.oid.value,
- "okUrl":form.okUrl.value,
- "failUrl":form.failUrl.value,
- "lang":form.lang.value,
- "rnd":form.rnd.value,
- "hashAlgorithm":form.hashAlgorithm.value,
- "email":form.email.value,
- "BillToName":form.BillToName.value,
- "encoding":form.encoding.value,
- "tel":form.tel.value,
- "BillToStreet1":form.BillToStreet1.value,
- "CallbackURL":form.CallbackURL.value
- }
- this.paiementService.testPaiementEnLigne(data).subscribe(
- data=>{
- form.hash.value=data;
- form.submit();
- },
- err=>{
- console.log(err);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement