Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
var request = require('request');

request({
	url: 'https://sandbox.pagbrasil.com/api/order/add',
	method: 'POST',
	form: {
		secret: 'input_your_secret',
		pbtoken: 'input_your_pbtoken',
		order: '1234567890_1',
		payment_method: 'B',
		product_name: 'Product Test (1 license)',
		customer_name: 'José da Silva',
		customer_taxid: '91051605962',
		customer_email: 'josedasilva@myemail.com.br',
		customer_phone: '11 3328.9999',
		address_street: 'Av.Paulista, 100',
		address_zip: '01311100',
		address_city: 'São Paulo',
		address_state: 'SP',
		amount_brl: '39.50',
		bol_expiration: '10'
	}},

	function (error, response, body) {
		if (!error && response.statusCode == 200) {
			console.log(body);
		}
	}
);

9.5. Response:

Code Block
languagexml
<?xml version="1.0" encoding="ISO-8859-1"?>
 <request>
 <order>1234567890</order>
 <payment_method>B</payment_method>
 <submission_date>10/12/2010</submission_date>
 <url_boleto>https://pagbrasil.com/b?b3b4cj7rf</url_boleto>
 <order_status>WP</order_status>
 <product_name>Product Test (1 license)</product_name>
 <customer_name>José da Silva</customer_name>
 <customer_taxid>91051605962</customer_taxid>
 <customer_email>josedasilva@myemail.com.br</customer_email>
 <customer_phone>11 3328.9999</customer_phone>
 <address_street>Av.Paulista, 100</address_street>
 <address_zip>01311100</address_zip>
 <address_city>São Paulo</address_city>
 <address_state>SP</address_state>
 <amount_brl>39.50</amount_brl>
 <signature>5e28e168fc3719774ea9c5b18b038768</signature>
 </request>

...