File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
advanced-integration/client Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ async function onApproveCallback(data, actions) {
96
96
}
97
97
}
98
98
99
- paypal
99
+ window . paypal
100
100
. Buttons ( {
101
101
createOrder : createOrderCallback ,
102
102
onApprove : onApproveCallback ,
@@ -110,9 +110,9 @@ function resultMessage(message) {
110
110
}
111
111
112
112
// If this returns false or the card fields aren't visible, see Step #1.
113
- if ( paypal . HostedFields . isEligible ( ) ) {
113
+ if ( window . paypal . HostedFields . isEligible ( ) ) {
114
114
// Renders card fields
115
- paypal . HostedFields . render ( {
115
+ window . paypal . HostedFields . render ( {
116
116
// Call your server to set up the transaction
117
117
createOrder : createOrderCallback ,
118
118
styles : {
@@ -172,10 +172,9 @@ if (paypal.HostedFields.isEligible()) {
172
172
return onApproveCallback ( data ) ;
173
173
} )
174
174
. catch ( ( orderData ) => {
175
- const { links, ...errorMessageData } = orderData ;
176
175
resultMessage (
177
176
`Sorry, your transaction could not be processed...<br><br>${ JSON . stringify (
178
- errorMessageData ,
177
+ orderData ,
179
178
) } `,
180
179
) ;
181
180
} ) ;
You can’t perform that action at this time.
0 commit comments