Forum PayVault consuming item by id

Discussion and help relating to the PlayerIO payment solution, PayVault.

consuming item by id

Postby wbsaputra » March 10th, 2011, 6:31 am

hi, need help with payvault, how can i consume single payvault item by id instead of key?
can i change "itemkey" with vault item id and no to used first method?? i want user select which item they can consume by id

//consume with itemkey and first method
client.payVault.consume(
[client.payVault.first("itemkey")], //
function():void{ trace("item consumed") },
function(e:PlayerIOError):void{ trace("Unable to consume item", e)
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm

Re: consuming item by id

Postby Oliver » March 14th, 2011, 5:20 pm

instead of calling .first(), you can loop over the .items array and find the item you wish to consume (based on id, for instance) and pass that directly to the consume() method.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: consuming item by id

Postby wbsaputra » March 18th, 2011, 2:46 am

ok, thanks. how about open transaction? when user trying to buy but they dont make any payment.
is there any way i can access that unsucessfull transaction and warn user or can i delete those open transaction?
Do i will be charge for that kind transaction?
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm

Re: consuming item by id

Postby Oliver » March 18th, 2011, 11:43 am

You can't delete nor access unsuccessfull transcations from the api methods (why would you want to?), and you're only charged for successful transactions.
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: consuming item by id

Postby wbsaputra » March 21st, 2011, 3:49 am

i just kind a messy with open transaction and not finished. :)
can i provide interface for user to reopening this unfinished transaction and offer user to redirect again to such paypal to finish their pending transaction? is possible doing that?
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm

Re: consuming item by id

Postby Oliver » March 21st, 2011, 5:46 am

can i provide interface for user to reopening this unfinished transaction and offer user to redirect again to such paypal to finish their pending transaction? is possible doing that?


Just start a new transaction and send the user on his/her way.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to PayVault



cron