The PaymentResponse object
This object is returned as the payload of the PaymentRequest object's token, paymentmethod, or source event handlers.
Object Properties
-
token object
A Token object. Present if this was the result of a
tokenevent listener. -
paymentMethod object
A PaymentMethod object. Present if this was the result of a
paymentmethodevent listener. -
source object
A Source object. Present if this was the result of a
sourceevent listener. -
complete function
complete(status) => voidis a Stripe.js provided function. Call this when you have processed the token data provided by the API. Note that you must must callcompletewithin 30 seconds.Accepts one of the following values:
Hide allowed status values
-
'success' value
Report to the browser that the payment was successful, and that it can close any active payment interface.
-
'fail' value
Report to the browser that you were unable to process the customer‘s payment. Browsers may re-show the payment interface, or simply show a message and close.
-
'invalid_
payer_ name' value Equivalent to
fail, except that the browser can choose to show a more-specific error message. -
'invalid_
payer_ phone' value Equivalent to
fail, except that the browser can choose to show a more-specific error message. -
'invalid_
payer_ email' value Equivalent to
fail, except that the browser can choose to show a more-specific error message. -
'invalid_
shipping_ address' value Equivalent to
fail, except that the browser can choose to show a more-specific error message.
-
-
payerName string
The customer's name. Only present if it was explicitly asked for when creating the PaymentRequest object.
-
payerEmail string
The customer's email. Only present if it was explicitly asked for when creating the PaymentRequest object.
-
payerPhone string
The customer's phone. Only present if it was explicitly asked for when creating the PaymentRequest object.
-
shippingAddress ShippingAddress
The final ShippingAddress the customer selected.
Only populated when
requestShippingistruewhen creating the PaymentRequest object, and you've supplied at least oneShippingOption. -
shippingOption ShippingOption
The final ShippingOption the customer selected.
Only present when
requestShippingistruewhen creating the PaymentRequest object, and you've supplied at least oneShippingOption. -
walletName string
The unique name of the wallet the customer chose to authorize payment. For example,
browserCard.
{ source: { id: "src_1FlM3yDbZnUGiCm0P8eqjAuI", object: "source", // ... } complete: function(status) { // Call this when you have processed the source data provided // by the API. Note that you must must call complete within 30 // seconds. }, payerName: 'Jenny Rosen', payerEmail: 'jenny@example.com', walletName: 'browserCard', shippingOption: { id: 'basic', label: 'Ground shipping', detail: 'Ground shipping via UPS or FedEx', amount: 995, } }