Jump to content
McKay Development

Is it possible to instantly confirm mobile confirmations?


botsbytim

Recommended Posts

i use like this, but not work.

cb4fd363950d4b3da98457b5e1e0965d.png

 

// Create and send the offer
offer.addMyItems(inventory);
offer.setMessage("Here, have some items!");
offer.send(function(err, status) {
if (err) {
console.log(err);
return;
}
 
if (status == 'pending') {
// We need to confirm it
console.log('Offer ' + offer.id +' sent, but requires confirmation');
community.acceptConfirmationForObject("my identify_secret", offer.id, function(err) {
if (err) {
console.log(err);
} else {
console.log("Offer confirmed");
}
});
} else {
console.log('Offer '+ offer.id +' sent successfully');
}
});
Link to comment
Share on other sites

 

i use like this, but not work.

cb4fd363950d4b3da98457b5e1e0965d.png

 

// Create and send the offer
offer.addMyItems(inventory);
offer.setMessage("Here, have some items!");
offer.send(function(err, status) {
if (err) {
console.log(err);
return;
}
 
if (status == 'pending') {
// We need to confirm it
console.log('Offer ' + offer.id +' sent, but requires confirmation');
community.acceptConfirmationForObject("my identify_secret", offer.id, function(err) {
if (err) {
console.log(err);
} else {
console.log("Offer confirmed");
}
});
} else {
console.log('Offer '+ offer.id +' sent successfully');
}
});

 

 

The confirmation's ID isnt the same as the trade id. Make it check confirmations if the status is pending and use the newConfirmation listener which emits a confirmation object. Then use CConfimation.id as offer id and accept it using that.

Link to comment
Share on other sites

The confirmation's ID isnt the same as the trade id. Make it check confirmations if the status is pending and use the newConfirmation listener which emits a confirmation object. Then use CConfimation.id as offer id and accept it using that.

 

acceptConfirmationForObject takes care of finding the correct confirmation for a given offer ID.

 

@maraya: What's your output?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...