Skip to content

Why Im getting a wrong payment ID? #323

Closed Answered by VickieAranha
Pacocc97 asked this question in Q&A
Discussion options

You must be logged in to vote

Helo @Pacocc97.
I have made some tests and its working properly.
You are correct, the payment ID is a number.
Please, try to apply my example,
this is how i got this done:

const client = new MercadoPagoConfig({
  accessToken: '<TOKEN>',
});

const payment = new Payment(client);
const body = {
  	transaction_amount: 12.34,
  	description: '<description>',
  	payment_method_id: 'pix',
  	payer: {
  		email: '<email>'
  	},
  };
 payment.create({
      body: body,
    })
    .then((response) => {
      console.log(response.id, 'response id');
     
    })
    .catch((error) => {
      console.log(error, 'error create_payment');
     
    });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VickieAranha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants