trakteer-scraper
trakteer-scraper copied to clipboard
Tolong tambahkan function createPayment()
trafficstars
referensi kode disini
Example
const TrakteerAPI = require("./src/index.js");
const cookies = "Q7c0sNT4XKSSoxsoAEwjs6aljaU0jNJr=???; XSRF-TOKEN=???; trakteer-sess=???;"
// Init cookies
const trakteerAPI = new TrakteerAPI(cookies);
// calculateTotalPay
trakteerAPI.calculateTotalPayment(2000, "qris", true)
.then(data => console.log('calculateTotalPay:', data))
.catch(error => console.error('Error:', error));
// Checking your account information
trakteerAPI.mySummary('your_account_id')
.then(data => console.log('mySummary:', data))
.catch(error => console.error('Error:', error));
// createPayment form
const formData = {
form: 'create-tip',
creator_id: 'your_account_id',
unit_id: 'unit_id', // you can get unit id from mySummary()
quantity: 2,
display_name: 'donator_name',
support_message: 'your_message_here',
times: 'once',
payment_method: 'qris',
is_anonym: 'on',
is_showing_email: 'on',
is_remember_next: 'on', // delete this if you don't want to get email from trakteer
supporter_id: ''
};
// create new payment
trakteerAPI.createPayment(formData)
.then(data => console.log('createPayment:', data))
.catch(error => console.error('Error:', error));
- Thx
nanti ya kalau ada waktu, ty