Download the PHP package youcanpay/payment-sdk without Composer
On this page you can find all versions of the php package youcanpay/payment-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package payment-sdk
This package allows the developer to interact easily with the YouCan Pay API.
This documentation is separated in two integrations: Default Integration and the Standalone Integration. you have the choice to do one integration or both integrations in your checkout page.
YouCan Pay SDK Setup
Instructions for adding the YouCan Pay SDK to your PHP Applications.
Step 1. Requirements
- YouCan Pay Account.
- Your YouCan Pay
private_key
andpublic_key
available in Settings > API Keys. - Visual Studio Code or Sublime Text or any IDE.
- Website with SSL, required only if you want to use the default mode for your payments.
- Composer installed in your development environment.
Step 2. Add YouCan Pay SDK
Open your PHP project, add the following.
- Run this command to download and include YouCan Pay PHP SDK in your project.
If you can't install composer, you can manually download the SDK from GitHub
https://github.com/NextmediaMa/youcan-payment-php-sdk/archive/refs/heads/master.zip
.
Step 2.1 YouCan Pay: Default Integration
The following is a quick guide to get up and started with YouCan Pay JS integration, you can view the full documentation by following this link.
You can make payments directly on your site, with the possibility of choosing the position in the DOM.
If you choose to use JS integration, you must have an SSL certificate to run in production mode.
2.1.1: Copy this JS script between <head>...</head>
2.1.2: Choose where you want to display payment information (Full Name, Card Numbers, CCV...), must be placed between the <body>...</body>
tags.
2.1.3: Add this code just before the end of the ...</body>
tag.
2.1.4: Tokenization step: this token contains all the order information.
2.5: Retrieve the token you created with the SDK createToken()
and insert it into the JS script, this token which contains all the information concerning this payment.
When the buyer clicks on the Pay button. the JS code below runs, and you receive a GET response in successUrl
or errorUrl
you defined in the tokenization step.
Step 2.2 YouCan Pay: Standalone Integration
2.2.1: Tokenization step: this token contains all the order information.
2.2.2: After the tokenization retrieve the link created with createPaymentURL()
function and integrate it in your DOM or redirect the buyer directly to this URL.