Unknown error while making paypal payment -
i using paypalvault make paypal payment.https://developer.paypal.com/docs/integration/direct/vault/
earlier code working fine every time make request gives internal server error.
{"event":"failure in making paypal payment","error":{"response":{"name":"internal_service_error","message":"an internal service error occurred.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"630132f195798","httpstatuscode":500},"httpstatuscode":500},"payment":null}
var express=require('express'); var paypal = require('paypal-rest-sdk'); paypal.configure({ 'mode' : "sandbox", //sandbox or live 'client_id' : "awnxucd4-azi1b8sqtwgf-difijxp_8mv62zkromikprwe9mjdly3x3aj1aazpdidwanhszh-xxdidhb", 'client_secret': "ensa2bke_7_weszx59jcfz3vks9dezhxnt3uh0o6ga515xreb0cuvwmpp8bmrhb9xkqs0wk42lq535p0" }); ///-------for creating card id--------------------///// // var cc_details = { // type: 'visa', // number: '4417119669820331', // expire_month: '11', // expire_year: '2019', // }; // paypal.credit_card.create(cc_details, function(error, credit_card){ // var credit_card_id; // var payer_id; // if(error){ // console.error(json.stringify(error)); // } else { // // card information needed process payment // console.log(credit_card); // credit_card_id = credit_card.id // } // }); //--------------------------------------------------///// var payment_data = { intent: 'sale', payer: { payment_method: 'credit_card', funding_instruments: [{ credit_card_token: { credit_card_id: "card-61v55904bf2950515lgmghoy" } }] }, transactions: [{ amount: { total : 100, currency: "usd" }, description: 'charge tookan merchant app' }] }; paypal.payment.create(payment_data, function (error, payment) { if (payment) { console.log(payment); } else { console.log(error); } });
Comments
Post a Comment