Evento de pagamento
Pessoal estou com um problema para homologar um pagamento service.
o resultado do Status deve ser sucessfull.
Parte do codido do index.
"
$('#payButton').one('click', function(){
var amount = $('input[name=amount]').val();
var currency = $('[name=currency]').val();
console.log(amount, currency);
V.init( {
apikey: '<?php echo $visaApiKey ?>',
settings: {
//logoUrl: 'https://www.novachance.org.br/wp-content/uploads/2018/06/xLogo_INC.jpg.pagespeed.ic.QrM-Azm3n5.jpg',
locale: 'en_US',
displayName: 'Viva a Musica',
websiteUrl: 'https://www.vivaamusica.org.br',
customerSupportUrl: 'https://www.vivaamusica.org.br/contato',
dataLevel: 'FULL'
},
paymentRequest: {
currencyCode: currency,
total: amount,
merchantRequestId: 'you can send any value to API ang get it in callback',
orderId: 'you can send any value to API ang get it in callback',
description: 'any order description if needs'
}
});
V.on('payment.success', function(payment) {
console.log('Visa success:', JSON.stringify(payment));
$('#succesOverlay').show();
$.ajax({
type: 'POST',
url: 'mailer.php',
data: {json: JSON.stringify(payment)},
dataType: 'json',
success: function(data){
console.log('Ajax success');
console.log(data);
location = 'thanks.php';
},
error: function(jqXHR, textStatus, errorThrown) {
console.log('Ajax error:');
console.log(textStatus, errorThrown);
}
});
});
V.on('payment.cancel', function(payment){
console.log('Canceled:', payment);
});
V.on('payment.error', function(payment, error){
console.log('Visa error:', payment, error);
});
$('.v-button').click();
})
"
Chamada Json
"
"Customer": {
"Name": "[$userFullName]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "Gama Gama",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "VisaCheckout",
"WalletKey": "1140814777695873901",
"Eci": 0
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": "eventStatus",
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL","en_US",
"Country": "BRA","USA",
"updateInfo": {
"payInfo": {
"reason": "Pagamento","Payment",
"avsResponseCode": "Y",
"Amount": 91.00,
"currencyCode": "USD",
"eventStatus": "Success",
"eventType": "Authorize",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
}
}
}
}
{
"
O pessoal da empresa me fala que tenho que enviar o CallID gerado ( não sei como faço isso) e fazer a chamado do alteração de evento quando a transação for sucesso.
Pensei em criar um aquivo payment.php mas pelo que li no manual necessariamente, não eh necessário.Discussão (0)
Carregando comentários...