check out integration problem please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so i have a website with shopify and i added the paypal payment however it only shows the yellow paypal button and i wanted to add the credit/debit card button to clients that won't have a paypal account so i followed the guide here :
https://developer.paypal.com/docs/checkout/standard/integrate/
and i changed the id to my id as shown in the code :
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- Replace "test" with your own sandbox Business account app client ID -->
<script src="https://www.paypal.com/sdk/js?client-id=AXjZHuB6JrbUTMM8akrA45AE6RC05DZy4Ntz9egW-yPMOX3spD3jKJDgppCy..."></script>
<!-- Set up a container element for the button -->
<div id="paypal-button-container"></div>
<script>
paypal.Buttons({
// Order is created on the server and the order id is returned
createOrder() {
return fetch("/my-server/create-paypal-order", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
// use the "body" param to optionally pass additional order information
// like product skus and quantities
body: JSON.stringify({
cart: [
{
sku: "YOUR_PRODUCT_STOCK_KEEPING_UNIT",
quantity: "YOUR_PRODUCT_QUANTITY",
},
],
}),
})
.then((response) => response.json())
.then((order) => order.id);
},
// Finalize the transaction on the server after payer approval
onApprove(data) {
return fetch("/my-server/capture-paypal-order", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
orderID: data.orderID
})
})
.then((response) => response.json())
.then((orderData) => {
// Successful capture! For dev/demo purposes:
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
const transaction = orderData.purchase_units[0].payments.captures[0];
alert(`Transaction ${transaction.status}: ${transaction.id}\n\nSee console for all available details`);
// When ready to go live, remove the alert and show a success message within this page. For example:
// const element = document.getElementById('paypal-button-container');
// element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: window.location.href = 'thank_you.html';
});
}
}).render('#paypal-button-container');
</script>
</body>
</html>
after that it showed the debit/credit card button and the yellow paypal button and another one which is added by shopify it self however the 2 that are added from the integration code when i click on them nothing happens it just wont work i don't know how to get it to work or where is the problem is
the arrows are referring to the integration code that i added and the buttons that wont work when i click and the square one is the button shopify added when i connected my paypal account to it and it works fine but i want to delete one of it and get the credit/debit card to work .
- Labels:
-
PayPal HTML Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day @xTottos,
Thank you for posting to the PayPal community.
To add "credit/debit card" button, please contact your website developer or support of eCommerce Shopify and pass the "enable-funding=card" in the PayPal JavaScript SDK to make sure guest checkout is offered as often as possible for the eligible customers/buyers.
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&enable-funding=card"> </script>
For details, see enable funding.
Option Description
card | Credit or debit cards |
https://developer.paypal.com/sdk/js/configuration/#enable-funding
Important : Unfortunately, Guest payment checkout(i.e payment via credit/debit without PayPal account) feature is not available for all Customers/Buyers.
Buyers don’t always have the option to make their purchases without using or creating a PayPal account. This option is presented based on several risk factors, including but not limited to the buyer's PayPal purchase history, PayPal cookies stored on the buyer's computer, the buyer's location, and/or a credit assessment.
It's important to remember that guest checkout is not guaranteed for every transaction. PayPal runs a risk check to determine eligibility for guest checkout. There will be times when guest checkout is not available.
Please refer the guide link - https://www.paypal.com/us/cshelp/article/how-do-i-accept-cards-with-checkout-using-the-guest-checkou...
Sincerely,
Chiranjeevi
PayPal/Braintree MTS
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your reply i made sure of everything yet still the credit/debit card is shown but wheneven i click on it nothing happenes like it's just a picture please test for your self on the site https://fashion-jewelry.co
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I click on the "PayPal and Debit or Credit card" buttons, the request is failing with "Status Code: 404 Not Found" while checking the "Network logs" of your website.
I would suggest to please contact the support of eCommerce Shopify who can help you regarding your website plugin/module issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks again for replying and helping me i contacted shopify and they said they do not support custom code idk how although that i added the code normally but here is what i found out this one is the from the console upon entering the page only
And this code here after i click on the debit/credit card button
is there is something in the code missed up ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok somehow i got the code fixed and now it's working normally but whenever i get an order it doesn't show the product name in the transaction id no details whatsoever it only shows a number but i don't know which product it is to fulfil the order
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Is it possible to make payments in RON (Romanian Leu) through PayPal? in REST APIs
- Things don’t appear to be working at the moment in PayPal Payments Standard
- [WooCommerce PayPal Payments] - Required phone country code, different than the cards country code. in PayPal Payments Standard
- Problem with invoices in REST APIs
- p is not a function error using the example downloaded from Paypal in SDKs