Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce_paypal-3317421
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
commerce_paypal-3317421
Commits
b2b7322d
Commit
b2b7322d
authored
2 years ago
by
Tom Ashe
Committed by
Jonathan Sacksick
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3200525
by TomTech: Paypal Response "Expected an Order ID to be passed".
parent
267e5ceb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/checkout/commerce_paypal_checkout.module
+2
-1
2 additions, 1 deletion
modules/checkout/commerce_paypal_checkout.module
modules/checkout/js/commerce_paypal_checkout.js
+4
-3
4 additions, 3 deletions
modules/checkout/js/commerce_paypal_checkout.js
with
6 additions
and
4 deletions
modules/checkout/commerce_paypal_checkout.module
+
2
−
1
View file @
b2b7322d
...
...
@@ -502,7 +502,8 @@ function commerce_paypal_checkout_create_order($order, $payment_method) {
$request_body
=
commerce_paypal_checkout_prepare_order_request
(
$order
,
$payment_method
[
'settings'
]);
drupal_alter
(
'commerce_paypal_checkout_create_order_request'
,
$request_body
,
$order
);
$json
=
$api_client
->
createOrder
(
$request_body
);
drupal_json_output
(
array
(
'id'
=>
$json
[
'id'
]));
drupal_add_http_header
(
'Content-Type'
,
'text/plain'
);
echo
isset
(
$json
[
'id'
])
?
$json
[
'id'
]
:
''
;
drupal_exit
();
}
catch
(
\Exception
$exception
)
{
...
...
This diff is collapsed.
Click to expand it.
modules/checkout/js/commerce_paypal_checkout.js
+
4
−
3
View file @
b2b7322d
...
...
@@ -18,9 +18,10 @@
$
(
'
.paypal-buttons-container
'
).
once
(
'
rendered
'
).
each
(
function
()
{
paypal
.
Buttons
({
createOrder
:
function
()
{
return
Drupal
.
paypalCheckout
.
makeCall
(
settings
.
createOrderUri
).
then
(
function
(
data
)
{
return
data
.
id
;
});
var
ajaxSettings
=
{
dataType
:
'
text
'
,
};
return
Drupal
.
paypalCheckout
.
makeCall
(
settings
.
createOrderUri
,
ajaxSettings
);
},
onApprove
:
function
(
data
)
{
Drupal
.
paypalCheckout
.
addLoader
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment