Pagsmile
  • Introduction
  • Reference
  • Payin API
    • Environments
    • All-In-One Checkout
      • Checkout Page (General)
      • Checkout Page (E-com)
    • Direct integration
      • Argentina
        • DebitCard
        • DEBIN
        • Khipu
        • QRCode
        • Rapipago
        • ❌Wallet
        • ❌Bank Transfer
        • ❌PagoFacil
      • Brazil
        • Credit Card
        • Credit Card Pre Auth
          • Capture
          • Void
          • Pagsmile JavaScript
        • Pix
        • Static Pix
        • Virtual PIX
          • Create Virtual PIX Account
          • Query Virtual PIX Account
          • Notification of Virtual PIX Account Payment
        • OpenFinance
        • Lottery
        • Boleto
        • Wallet
        • ❌Credit Card
        • ❌Deposit Express
      • Mexico
        • Credit Card
        • SPEI
        • Virtual SPEI
          • Create Virtual SPEI Account
          • Query Virtual SPEI Account
          • Cancel Virtual SPEI Account
          • Check Usage of Virtual SPEI Account
          • Notification of Virtual Account Payment
        • CoDi
        • OXXOPay
        • Cash
        • Wallet
        • ❌OXXO
      • Colombia
        • PSE
        • Transfiya
        • Efecty
        • Bancolombia
        • SuRed
        • Wallet
        • Gana
        • ❌Baloto
      • Chile
        • Webpay
        • Khipu
        • Pago46
        • Bank Transfer
        • ❌Cash
        • Wallet
      • Peru
        • Credit Card
        • Bank Transfer
        • Cash
        • QRCode
        • ❌Pagoefectivo
      • Ecuador
        • Credit Card
        • Bank Transfer
        • Cash
      • Costa Rica
        • Cash
        • BNCR
        • ❌Bank Transfer
      • Panama
        • Cash
        • ❌Bank Transfer
      • Guatemala
        • Cash
        • ❌Bank Transfer
      • Bolivia
        • ❌Bank Transfer
      • Paraguay
        • ❌Bank Transfer
      • Uruguay
        • ❌Bank Transfer
      • El Salvador
        • ❌Cash
      • Nigeria
        • Bank Transfer
      • China
        • Wallet
        • Vault
      • Hongkong
        • Wallet
      • Taiwan
        • Bank Transfer
        • OTC
        • PostTransfer
        • Wallet
      • Indonesia
        • Bank Transfer
        • QRIS
        • Wallet
      • South Korea
        • Wallet
        • Bank Transfer
        • Virtual Account
      • Singapore
        • Wallet
      • Malaysia
        • Wallet
        • Vault
      • Philippines
        • AlipayPlus
        • QRPH
        • Wallet
        • Vault
      • Thailand
        • Wallet
      • Vietnam
        • QRCode
      • Türkiye
        • Wallet
      • Egypt
        • Credit Card
        • Wallet
        • Cash
        • Kiosk
      • Saudi Arabia
        • Credit Card
      • Kuwait
        • Credit Card
      • Qatar
        • Credit Card
      • Oman
        • Credit Card
      • United Arab Emirates
        • Credit Card
      • Bahrain
        • Credit Card
      • Kazakhstan
        • Credit Card
      • Uzbekistan
        • Credit Card
      • Europe
        • Credit Card
        • Wallet
      • North America
        • Credit Card
        • Wallet
    • Notification
      • Security
    • Recurring Payment
      • Support Target and Currency
    • PCI Direct Integration
      • Tokenization
      • Create Card Payment
      • Authorization
      • Capture
      • Void
    • Account Balance
    • Payin Detail
    • Refund
    • Plug-in & Tools
      • Pagsmile JavaScript
      • Pagsmile SDK
      • Get CreditCard Token
      • Supported Bank List Query
      • Installment Detail Query
      • Payin SFTP Report
    • Data
      • Bank list
        • Bank in Colombia
      • Country Code
      • Data for test (Sandbox)
      • Icon of methods
      • Payment Method
      • Payin Status
    • API Code
  • Payout API
    • Environments
    • Security
    • Submit a payout
      • Pagsmile Wallet
        • WebView Example
        • H5 Authorization
        • Native App Authorization
        • Send Prizes
      • PayPal
        • ❌Supported Countries
      • Argentina
        • Wallet
        • BankTransfer
      • Bolivia
        • ❌BankTransfer
      • Brazil
        • Pix
        • BankTransfer
      • Chile
        • Wallet
        • BankTransfer
      • Colombia
        • Wallet
        • Transfiya
        • BankTransfer
      • Costa Rica
        • ❌BankTransfer
      • Ecuador
        • BankTransfer
      • Guatemala
        • ❌BankTransfer
      • Mexico
        • SPEI
      • Panama
        • ❌BankTransfer
      • Peru
        • BankTransfer
        • Regions in Peru
      • Turkey
        • Wallet
        • BankTransfer
      • Uruguay
        • ❌BankTransfer
      • Vietnam
        • BankTransfer
    • Notification
    • Payout DryRun
    • Checkout Page
    • Account Balance
    • Payout Proof
    • Payout Status
    • Payout Bank List
    • Payout List
    • Payout Detail
    • Payout SFTP Report
    • Payment Method
    • Data for test
    • Bank Code
      • Bank in Argentina
      • Bank in Bolivia
      • Bank in Brazil
        • Bank in Brazil (TED)
      • Bank in Chile
      • Bank in Colombia
      • Bank in Costa Rica
      • Bank in Ecuador
      • Bank in Guatemala
      • Bank in Mexico
      • Bank in Panama
      • Bank in Peru
      • Bank in Uruguay
    • API Code
  • Issuing Card API
    • Environments
    • Security
    • Common
    • Business
      • Partner
        • Create Deposit Order
        • Query Deposit Result
        • Transfer
        • Query Partner Balance
        • Query Partner Transactions
      • Cardholder
        • Create Cardholder
        • Update Cardholder
        • Query Cardholder
        • Upload Supporting Documents
        • Create Corporation Cardholder
        • Update Corporation Cardholder
        • Query Corporation Cardholder
      • Card
        • Apply For a Card
        • Query Apply Result
        • Query Card Information
        • Topup a Card
        • Card Balance Return
        • Query Card Balance
        • Update a Card
          • Revoke
          • Block a Card
          • UnBlock a Card
        • Retrieve Password
        • Query Transaction Detail information
        • Query Transactions
        • Query Authorizations
        • Card Limit
          • Create Card Limit
          • Update Card Limit
          • Query Card Limit
          • Query Default Card Limit
          • Query Remaining Card Limit
        • Query Available Card BINs
      • Webhook
        • Manage Webhook URL
          • Create Webhook URL
          • Update Webhook URL
          • Query Webhook URL
        • Apply Card Result Notification
        • Card Status Notification
        • Cardholder Audit Status Notification
        • Authorization Details Notification
        • OTP Information Notification
    • Data
      • Dictionary Item
        • CustomerType
        • CustomerAuditStatus
        • Customer Codes
        • Gender
        • IdType
        • CustomerStatus
        • RiskLevel
        • CardOrderStatus
        • CardType
        • CardSchema
        • CardStatus
        • TransactionType
        • TransationStatus
        • CardLog.logType
        • AccountStatus
        • AuthStatus
        • AuthSettleStatus
        • ProcessStatus
        • FeeMethod
        • FeeStatus
        • NotificationStatus
        • Currency
        • CustomerFileType
        • WebhookType
        • ResponseCode
        • CHARSETS
        • CountryCode
      • Trade Currency
  • Remittance API
    • Environments
    • Security
    • Common
    • Business
      • Onboard
        • Create Corporation
        • Update Corporation
        • Query Corporation
        • Create Individual
        • Update Individual
        • Query Individual
        • Add Shop
        • Delete Shop
        • Query Shops
      • Collection
        • Apply VA
        • Query Apply VA Result
        • Apply VA Result Notification
        • Collection Notification
        • Query Collections
        • Create Material
        • Upload Material Document
        • Submit Material Document
        • Query Materials
        • Material Audit Result Notification
        • Link Material and Collection
        • Query Linked Materials By Collection
        • Link Result Notification
      • Exchange
        • Query Support Currency Pairs
        • Query Quote
        • Create Exchange Order
        • Query Exchange Orders
      • Payment
        • Query Payment Fields
        • Add Payee
        • Update Payee
        • Delete Payee
        • Query Payee Detail
        • Create Payment Order
        • Query Payment Orders
        • Payment Result Notification
      • Withdrawal
        • Add Withdrawal Account
        • Update Withdrawal Account
        • Delete Withdrawal Account
        • Query Withdrawal Account Detail
        • Create Withdrawal Order
        • Query Withdrawal Orders
        • Withdrawal Result Notification
      • Transfer
        • Internal transfer
      • Account
        • Query Account Balance
        • Query Account Transactions
      • Partner
        • Create Topup Order
        • Query Topup Result
        • Query Partner Balance
        • Query Partner Transactions
      • Webhook
        • Webhook Common
        • Manage URL
          • Create Webhook URL
          • Update Webhook URL
          • Query Webhook URL
    • Data
      • Dictionary Item
        • Business Type
        • Business Category
        • Webhook Type
        • All Collection Status
        • Transaction Type
        • Transaction Status
        • Gender
        • Id Type
        • File Type
        • Fixed Side
        • Order Status
        • Pay Type
        • Payee Type
        • Currency
        • CHARSETS
        • Country Code
      • Trade Currency
  • E-com Platform
    • Shopify
    • Shoplazza
    • WIX
    • Woocommerce
  • Country Info
  • OTHER
    • Changelog
Powered by GitBook
On this page
  • Notification
  • Events
  • Verifying signatures (optional)
  • Notification Example

Was this helpful?

  1. Payin API

Notification

IPN (Instant Payment Notification) is a notification sent from one server to another through an HTTP POST request informing your transactions.

To receive notifications about the events in your platform, you have to previously configure the notification when you do the POST of the payment, indicating the URL in the field notify_url.

Notification

POST $notify_url which defined when submitting the payin transaction.

Notification Parameters

Headers

Name
Type
Description

Content-Type*

String

application/json

Pagsmile-Signature*

String

t=$timestamp,v2=HMAC SHA256($RequestBody)

Request Body

Name
Type
Description

trade_no*

String

Pagsmile transaction id

out_trade_no*

String

merchant out_trade_no

out_request_no

String

Pagsmile refund transaction id. Only for refund order

app_id*

String

trade_status*

String

trade status.

amount*

String

method*

String

currency*

String

timestamp*

String

channel

String

success

Events

Whenever an event occurs, we will send you a notification in json format using HTTP POST to the URL that you specified.

We will notify the following events:

Action
Description

SUCCESS

Trade has been successful

CANCEL

Trade has been cancelled

EXPIRED

Trade is expired

REFUSED

Trade has been refused

REFUSE_FAILED

Trade is failed to refuse

CHARGEBACK

Chargeback occurred

CHARGEBACK_REVERSED

Chargeback reversed

REFUND_REVOKE

Refund revoke

REFUND_REFUSED

Refund is refused

REFUNDED

Trade has been refunded

DISPUTE

Dispute occurred

We can notify the following events, contact us to set up if needed:

Action
Description

PROCESSING

User has submitted the payment information

RISK_CONTROLLING

Trade is considered high risk or there is unclear billing information

REFUND_VERIFYING

Waiting for the user to submit refund information

REFUND_PROCESSING

Refund information is received. Waiting for processing the refund.

Pagsmile will send notifications with the following schedule of retries and confirmation waiting times. You must return an HTTP STATUS 200 (OK) with response data "success" before the corresponding time expires. If not, it will be assumed that you did not receive it correctly and you will be notified again.

It is recommended that you respond to the notification before executing business logic or before accessing external resources so as not to exceed the estimated response times.

This communication is exclusively between the servers of Pagsmile and your server, so there will not be a physical user seeing any type of result.

Event
Time after the first dispatch

Dispatch

-

1st retry

10 minutes

2nd retry

30 minutes

3rd retry

60 minutes

4th retry

120 minutes

5th retry

360 minutes

6th retry

840 minutes

Verifying signatures (optional)

The approximate content of the Pagsmile-Signature header is as follows (here with line breaks for easy viewing, the actual content is all on one line):

Pagsmile-Signature:
t=1577808000,
v2=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

The Pagsmile-Signature header contains a timestamp and a signature. The timestamp is prefixed by t=, followed by a UNIX timestamp; the signature is prefixed by v2=, followed by the signature content.

Step 1 : Extract the timestamp and signatures from the header

Split the header using the [,] character as the separator, to get a list of elements. Then split each element using the [=] character as the separator, to get a prefix and value pair.

The value for the prefix [t] corresponds to the timestamp, and [v2] corresponds to the signature. You can discard all other elements.

Step 2 : Prepare the original RequestBody string

Get all the content in the RequestBody. Please pay attention here. Please do not use the program's self-built structure to format and/or serialize the RequestBody content. If you have similar requirements, please do it after getting the original data for verification to avoid unnecessary sorting of fields and the addition of characters affecting the signature.

Step 3 : Determine the expected signature

Compute an HMAC with the SHA256 hash function. Use the SecretKey get from The merchant dashboard as the key(salt), and use the original RequestBody string as the message.

Step 4 : Compare the signatures

Compare the signature in the header to the expected signature. For an equality match, compute the difference between the current timestamp and the received timestamp, then decide if the difference is within your tolerance.

Notification Example

The following notification is only an example. Different methods can have more or less parameters in the real notification. Please refer to what you received when testing.

Content-Type: application/json
Method: POST
Header: t=1645516741, v2=f6e345eca80d74c470ba456b7b559046f22b49fcaad9b81938ff1488b0f497ac
Body:
  {
    "amount": "12.01",
    "out_trade_no": "202201010354002",
    "method": "PIX",
    "channel": "",
    "trade_status": "SUCCESS",
    "trade_no": "2022022201111100011",
    "currency": "BRL",
    "out_request_no": "",
    "app_id": "162************38",
    "timestamp": "1645516741",
    "user": {
        "buyer_id": "",
        "identify":{
            "type": "CPF",
            "number": "50284414727"
        },
        "username": "test user name",
        "phone": "75991435892",
        "email": "test@pagsmile.com",
        "ip": ""
    },
    //Currently only PIX and SPEI return the payer's information. 
    "payer": { 
	"account": {
	    "number": "",
	    "type": ""
	},
	"identification": {
	    "number": "",
	    "type": ""
	},
	"username": "",
	//Currently Only PIX return the payer's bank account information.
	"bank": {
	    "agency": "",
	    "bank_id": "",
	    "bank_name": ""
	}
    },
    //Currently only CreditCard methods return the payer's card information.
    "card": {
        "card_no": "",
        "first_six_digits": "",
        "last_four_digits": ""
    },
    //Currently only CreditCard methods may return chargeback reasons.
    "chargeback_reason": {
        "code": "",
        "card_brand": "",
        "description": "",
        "type": ""
    }
  }

Please contact us to get the IP addresses that our notifications will be sent from.

PreviousWalletNextSecurity

Last updated 2 months ago

Was this helpful?