Payments Processing
#
About this guideIn this guide we will describe the step-by-step process for you to process payments with PicPay by our logged payment solution.
#
before startingBefore processing online payments by our PicPay 1-Click solution, you must have a valid, non-expired access_token
. You can check how to generate your tokens in this article.
#
How it works#
AuthenticationIn addition to the access_token
, generated dynamically, the payment end-point also needs an Api-Key
that will be informed with your client_id
and client_secret
.
About the Api-Key
The Api-Key
must not be shared in any way and must be stored securely on their servers.
#
Generating a charge to the user's walletWith a valid access_token
, the process of generating a charge on the customer's wallet is extremely simple. The charge must be generated by the end-point v1/payments/charge
, indicating the amount to be debited in the body of the request. In the example below, we are requesting the charge of BRL 3.00 to the user's wallet.
Below is an example of a successful return. The transaction_id
and reference_id
fields should be stored as they are the keys for refund processes.
#
What will be the origin of the funds?The charge amount may be debited from the credit card, balance or both (balance + card). If the customer has the Use balance option enabled in the App, we will first consume the user's balance and later (if there is not enough balance), charge the card.
Example: I'm making a purchase of R$60, I have a balance of R$19 in my wallet. PicPay will consume R$19 and charge the registered card for R$41.
#
Error MessagesWe do not report error codes on transaction returns. We only inform you if the transaction was approved or not.
#
Payment TimeoutCurrently, a payment has a default timeout value of 30 seconds. This management is handled internally to prevent issues with unauthorized charges. In practice, if the payment takes longer than 30 seconds to return a success, the API will return a 500 error, and if the payment is resolved later, it will automatically be undone through an automatic refund.
If your API has a timeout different from 30 seconds, you will need to request this change for your integration.
In these cases, the request will respond with the HTTP Status Code 408 Request Timeout and with the following body:
#
Next Steps#
Getting helpWe hope this article has helped! If you have any questions, you can consult our FAQ or contact us by e-mail : relacionamento-negocios@picpay.com.