Visa Developer Community

Regular Visitor

Visa checkout integration Angular 6 with type script

i want to integrate visa checkout to my angular 6 application. following is the html file and the type script file basic flow. its not functioning properly with typescript code. 
 
html file
 
<img class="v-button" role="button" tabindex="0" src="https://sandbox.secure.checkout.visa.com/wallet-services-web/xo/button.png" alt="Visa Checkout" />
 
 
 
typescript file
 
declare var V;
 
export class CheckoutComponent implements AfterViewInit {

ngAfterViewInit() {
console.log('ngAfterViewInit: Visa Checkout sdk.js is loaded and button is displayed.');
this.onVisaCheckoutReady();
}

onVisaCheckoutReady() {
V.init( {
apikey: "XXXXXXXXXXXXX",
 
settings: {
},
paymentRequest:{
currencyCode: "USD",
total: "10.00"
}
});
V.on("payment.success", function(payment) {
// document.write(JSON.stringify(payment));
console.log(payment);
$.ajax({
type: 'POST',
url: 'Decrypt.php',
data: {json: JSON.stringify(payment)},
dataType: 'json',
success: function(data){
// var response = JSON.stringify(data);
document.write(data);
alert("Successful callback");
},
error: function() {
console.log('Cannot retrieve data.');
}
})
 
});
 
V.on("payment.cancel", function(payment)
{alert(JSON.stringify(payment)); });
V.on("payment.error", function(payment, error)
{alert(JSON.stringify(error)); });
 
 
2 REPLIES 2
Visa Dev Moderator

Re: Visa checkout integration Angular 6 with type script

Hello,

 

We are looking into the below issue and will keep you posted soon.


Thanks,

Jai

Highlighted
Visa Dev Moderator

Re: Visa checkout integration Angular 6 with type script

Hi,

Since this involves a lot of back and forth troubleshooting, please reach out to Visa Checkout team @ developer-support@mail.digital.visa.com directly.

 

Thanks,

Jai