WebAPI/WebPaymentProvider: Difference between revisions

Jump to navigation Jump to search
Line 56: Line 56:
== Notifications ==
== Notifications ==


* When the payment processing is finished, the payment provider must send a POST to either a postback URL or chargeback URL of the app. The app developer must register these URLs with the payment provider before making calls to <code>navigator.mozPay()</code> or it can specify the callback URLs in the JWT that is passed into <code>navigator.mozPay()</code>.
* When the payment processing is finished, the payment provider must send a POST to either a postback URL or chargeback URL of the app. These URLs are defined in the JWT passed into <code>navigator.mozPay()</code> for each request.
* The payment provider signs a JWT with the same shared secret as with invocation and POSTs this to either the postback or chargeback URL. The POST must only include the JWT in its payload.
* The payment provider signs a JWT with the same shared secret as with invocation and POSTs this to either the postback or chargeback URL. The POST must be a standard <code>application/x-www-form-urlencoded</code> request with the JWT passed as form parameter <code>notice=JWT</code>.
* The JWT must include the original request as well as an additional response object that specifies the payment provider’s transaction ID.
* The JWT must include the original request as well as an additional response object that specifies the payment provider’s transaction ID.
* When a payment is successful a notification is sent to the postback URL.
* When a payment is successful a notification is sent to the postback URL.
* When a payment is unsuccessful due to insufficient funds or some kind of processing failure a notification is sent the chargeback URL.
* When a payment is unsuccessful due to insufficient funds or some kind of processing failure a notification is sent the chargeback URL.
* When a payment is refunded some time in the future a notification is sent to the chargeback URL.  
* If a payment is refunded some time in the future a notification is sent to the chargeback URL.  
* The app must respond to the POST with a 200 OK status and must return a plain text response of the transaction ID.
* The app must respond to the POST with a 200 OK status and must return a plain text response of the transaction ID.
* If the app server does not respond with a 200, the notification should be retried a few times and stored in a queue if the request never goes through.
* If the app server does not respond with a 200, the notification should be retried a few times and stored in a queue if the request never goes through.
Confirmed users
324

edits

Navigation menu