youcan-shop / youcan-payment-php-sdk Goto Github PK
View Code? Open in Web Editor NEWYouCan Pay PHP SDK
Home Page: https://pay.youcan.shop
License: MIT License
YouCan Pay PHP SDK
Home Page: https://pay.youcan.shop
License: MIT License
Hi,
[Sandbox mode] When I submit the form for the first time after reloading the page, it works as normal. However, if the form has an error (e.g. an invalid card expiration date), and I correct the error and try to resubmit the form, I get an error saying 'listener already attached for window undefined'
Please see the video below
https://drive.google.com/file/d/1oMB__ZCCT4diG6K-5qbbPvgAhO-9X4Cn/view
I used the exact code from the documentation ( Replace the Sandbox public key and transaction Token )
https://youcanpay.com/docs#testing_and_test_cards
Did I miss anything, or is there an issue with the ycpay.js file?
I got {"success":false,"message":"account not found"}
every time I use sandbox private key to generate a token at endpoint https://youcanpay.com/api/tokenize
.
Hi, i am using the Standalone Integration, the library works fine in the sandbox mode but the issue is that when i switch to live mode it never hits the success_url after payment. after the 3DS verification and the payment is done, the payment page gets automatically closed without hitting the success_url.
why i don't get any response this the code :
useKeys('pri_9fb67306-af64-449f-bacf-18a556f3', 'pub_a01b7b41-0e42-4a56-a165-1bc55244'); // Data of the customer who wishes to make this purchase. // Please keep these keys. $customerInfo = [ 'name' => '', 'address' => '', 'zip_code' => '', 'city' => '', 'state' => '', 'country_code' => '', 'phone' => '', 'email' => '', ]; $metadata = [ // Can you insert what you want here... //'key' => 'value' ]; $token = $youCanPay->token->create( "order-id", "1000", "USD", "123.123.123.123", "https://yourdomain.com/orders-status/success", "https://yourdomain.com/orders-status/error", $customerInfo, $metadata ); return $token->getId(); } } ?><script type="text/javascript">
// Create a YouCan Pay instance.
const ycPay = new YCPay(
"pub_a01b7b41-0e42-4a56-a165-1bc55244", {
formContainer: "#payment-card",
locale: "en",
isSandbox: true,
errorContainer: "#error-container",
}
);
ycPay.renderCreditCardForm();
</script>
<script type="text/javascript">
document.getElementById("pay").addEventListener("click", function() {
// Execute the payment, it is required to put the created token in the tokenization step.
ycPay
.pay("<?php (new ExamplePayment())->createToken() ?>")
.then(successCallback)
.catch(errorCallback);
});
function successCallback(transactionId) {
alert("success");
}
function errorCallback(errorMessage) {
alert("faild");
}
</script>
Can the sdk be integrated in flutter in any possible way ? (Http requests maybe ?)
Hello, can anyone help me integrate YOUCANPAY on shopify, i have low knowldge in coding ... when m trying to insert the php code i couldnt edit checkout page source code on shopify.
Thank you
<div id="ycp-3ds-modal">
<style>[Promise Object]</style>
</div>
due to a promise not awaited in ycpay.js
rn = Promise.resolve().then((function () {
return ii
}));
Hello YouCanPay team, I'm Hamza from Morocco I have a website based on subscriptions, to access premium content you need to pay 9$ per month
Does YouCanPay support subscriptions ?
How to reproduce:
I make the payment over the Rest API with the INSOMNIA client so it's clear, first I send this request:
then I take that token.id
and execute a payment with a test card:
as you see the response is a 500 internal server error, but in my dashboard, it shows that the operation did been executed successfully:
as you see the id of the order is 105 same as what I did tokenize, but it just returns a 500 server error.
I see that there is many SDK for YouCan pay in android, ios, and flutter ( which I was trying so it leads me to point the problem ) and they will be affected since it relies on HTTP requests.
I'm testing with the sandbox api endpoint : https://youcanpay.com/sandbox/api/pay
Hello Guys,
I was wondering if u can link the YCP API with a shopify store or any other store ?
Thanks in advance guys
During rendering credit card form in sandbox mode i get this error message :Cannot read properties of undefined (reading 'payments_active').
I made live transaction by my credit card in the live mode it works fine
note: sandbox mode activated in youcan dashboard, i use public sandbox key for frontend code, public and private sandbox key for backend.
const ycPay = new YCPay('pub_sandbox_xxxxxxx',
{
isSandbox:true,
formContainer: '#payment-container',
locale: 'en',
errorContainer: '#error-container'
});
ycPay.renderCreditCardForm();
</script>
With js lib
https://youcanpay.com/js/ycpay.js
The error happens in rendered youcan form -> Card Number field, on past event:
Uncaught TypeError: Cannot read properties of undefined (reading 'dataset') at ShadowRoot.<anonymous> (ycpay.js:256:7491)
tried rendering with empty gateways array,
renderAvailableGateways([], "default")
also with ["CreditCard"]
After payment has been completed and the user is redirected back to either the success or error URL on the merchant website with the transaction ID and other info about the transaction. This response is sent via a get request. Is there a way to verify that the reponse sent to the callback URL is coming from YouCan Pay servers??
Is there an API endpoint for independently verifying if a transaction is successful or vice versa?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.