-
Notifications
You must be signed in to change notification settings - Fork 0
/
PaymentValidationErrors.cljs
86 lines (69 loc) · 2.84 KB
/
PaymentValidationErrors.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
(ns web.payments.PaymentValidationErrors
"The PaymentValidationErrors dictionary represents objects providing
about any and all errors that occurred while processing a payment
When validation of the `web.payments.PaymentResponse` returned
the `PaymentRequest.show()` or `PaymentResponse.retry()` methods
your code creates a PaymentValidationErrors object to pass into
so that the user agent knows what needs to be fixed and what
any error messages to display to the user."
(:refer-clojure :exclude []))
(defn error
"Property.
A general description of a payment error from which the user
attempt to recover by retrying the payment, possibly after correcting
in the payment information. error can be provided all by itself
provide only a generic error message, or in concert with the
properties to serve as an overview while other properties' values
the user to errors in specific fields in the payment form."
[this]
(-> this (.-error)))
(defn set-error!
"Property.
A general description of a payment error from which the user
attempt to recover by retrying the payment, possibly after correcting
in the payment information. error can be provided all by itself
provide only a generic error message, or in concert with the
properties to serve as an overview while other properties' values
the user to errors in specific fields in the payment form."
[this val]
(aset this "error" val))
(defn payer
"Property.
A PayerErrors compliant object which provides appropriate error
for any of the fields describing the payer which failed validation."
[this]
(-> this (.-payer)))
(defn set-payer!
"Property.
A PayerErrors compliant object which provides appropriate error
for any of the fields describing the payer which failed validation."
[this val]
(aset this "payer" val))
(defn payment-method
"Property.
Any payment method specific errors which may have occurred. This
contents will vary depending on the payment used. For example,
the user chose to pay by credit card using the basic-card payment
this is a BasicCardErrors object."
[this]
(-> this (.-paymentMethod)))
(defn set-payment-method!
"Property.
Any payment method specific errors which may have occurred. This
contents will vary depending on the payment used. For example,
the user chose to pay by credit card using the basic-card payment
this is a BasicCardErrors object."
[this val]
(aset this "paymentMethod" val))
(defn shipping-address
"Property.
An AddressErrors object which contains error messages for any
the fields in the shipping address that failed validation."
[this]
(-> this (.-shippingAddress)))
(defn set-shipping-address!
"Property.
An AddressErrors object which contains error messages for any
the fields in the shipping address that failed validation."
[this val]
(aset this "shippingAddress" val))