Search code examples
androidandroid-studiobluesnap

how to generate the bluesnap token before payment


I want to generate the Bluesnap token before the order payment, but i am getting the token after the payment successfully done. There is no way to retry last unsuccessful payment because i need token to retry the last unsuccessful payment. please help me.


Solution

  • The hosted payment field token is used to pass the shopper credit card details in a secure way, and it can only be used once. But once you crated a transaction for a using the hosted payment field token, you'll get a vaulted shopper ID in the API response. and you can use this vaulted shopper id parameter to perform subsequent transactions on the same shopper without collecting the shopper CC info again. If the transaction attempt fail then a shopper will not be created, and you will get an error in the response. So if you want to avoid this behavior, you can use the hosted payment field token to do a create vaulted shopper API call. https://developers.bluesnap.com/v8976-JSON/docs/create-vaulted-shopper with create vaulted shopper, blue snap will only make sure that the shopper credit card is valid and can be charged, and then you can save the vaulted shopper ID you got in the response on your end, and use it to run transactions on the shopper.