Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github

Adyen online payment integration demos

Run this integration in seconds using Gitpod

  • Open your Adyen Test Account and create a set of API keys.
  • Go to gitpod account variables.
  • Set the ADYEN_API_KEY, ADYEN_CLIENT_KEY,
    export ADYEN_API_KEY=yourAdyenApiKey
    export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
    export ADYEN_CLIENT_KEY=yourAdyenClientKey
    export ADYEN_HMAC_KEY=yourHmacKey
    
    0 and
    export ADYEN_API_KEY=yourAdyenApiKey
    export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
    export ADYEN_CLIENT_KEY=yourAdyenClientKey
    export ADYEN_HMAC_KEY=yourHmacKey
    
    1 variables.
  • Click the button below!

Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github

NOTE: To allow the Adyen Drop-In and Components to load, you have to add

export ADYEN_API_KEY=yourAdyenApiKey
export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
export ADYEN_CLIENT_KEY=yourAdyenClientKey
export ADYEN_HMAC_KEY=yourHmacKey
2 as allowed origin for your chosen set of API Credentials

Details

This repository includes examples of PCI-compliant UI integrations for online payments with Adyen. Within this demo app, you'll find a simplified version of an e-commerce website, complete with commented code to highlight key features and concepts of Adyen's API. Check out the underlying code to see how you can integrate Adyen to give your shoppers the option to pay with their preferred payment methods, all in a seamless checkout experience.

Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github

Supported Integrations

Laravel 9 demos of the following client-side integrations are currently available in this repository:

  • Drop-in
  • Component
    • ACH
    • Alipay
    • Card (3DS2)
    • iDEAL
    • Dotpay
    • giropay
    • SEPA Direct Debit
    • SOFORT

Each demo leverages Adyen's API Library for PHP (GitHub | Docs).

Requirements

PHP 8.0.0+

Installation

  1. Clone this repo:

git clone https://github.com/adyen-examples/adyen-php-online-payments.git

  1. Navigate to the root directory and install dependencies:

Usage

  1. Rename .env.example to .env

  2. Set environment variables for the required configuration (API key, Client Key, and merchant account name)

On linux that looks like this :

export ADYEN_API_KEY=yourAdyenApiKey
export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
export ADYEN_CLIENT_KEY=yourAdyenClientKey
export ADYEN_HMAC_KEY=yourHmacKey

  1. Start the server:

php artisan key:generate && php artisan serve

  1. Visit http://localhost:8080/ (./resources/views/pages/index.blade.php) to select an integration type.

To try out integrations with test card numbers and payment method details, see Test card numbers.

Contributing

We commit all our new features directly into our GitHub repository. Feel free to request or suggest new features or code changes yourself as well!

Find out more in our Contributing guidelines.

License

MIT license. For more information, see the LICENSE file in the root directory.

Payment-Gateway-Using-PHP

PayayRequestCreate (mảng $ payment_request) Tạo yêu cầu thanh toán mới. PayayRequestStatus ($ id) Nhận chi tiết về yêu cầu thanh toán được chỉ định bởi ID duy nhất của nó. PayayRequestSlist (mảng $ datetime_limits) Nhận danh sách tất cả các yêu cầu thanh toán. Đối số $ datetime_limits là tùy chọn Một có thể được sử dụng để lọc các yêu cầu thanh toán theo ngày tạo và sửa đổi của chúng. Thông số tạo yêu cầu thanh toán Yêu cầu Mục đích: Mục đích của yêu cầu thanh toán. . (Max-Staracters: 100) Email: Email của người trả tiền. (Max-Staracters: 75) Điện thoại: Số điện thoại của người trả tiền. Send_email: Đặt điều này thành True nếu bạn muốn gửi email cho người trả tiền nếu email được chỉ định. Nếu email không được chỉ định thì một lỗi được nêu ra. . Nếu điện thoại không được chỉ định thì lỗi được nêu ra. . Người mua sẽ được chuyển hướng ở đây sau khi thanh toán thành công. Webhook: Đặt điều này thành một URL có thể chấp nhận các yêu cầu POST do Instamojo Server thực hiện sau khi thanh toán thành công. allow_repeated_payments: Để không cho phép nhiều khoản thanh toán thành công trên yêu cầu thanh toán vượt qua sai cho trường này. Nếu điều này được đặt thành sai thì liên kết không thể truy cập được công khai sau khi thanh toán thành công đầu tiên, mặc dù bạn vẫn có thể truy cập nó bằng API (giá trị mặc định: true).

Tài liệu khác có sẵn tại https://docs.instamojo.com/v1.1/docs

Instamozo-paymentgateway-php (PHP, Bootstrap 4+, CSS, HTML-5, JQuery)

    Debit = 4242 4242 4242 4242
    Expiry =1221
    cvv = 111
    security pin = 1221

Đầu tiên bạn tạo một tài khoản trên Instamojo https://test.instamojo.com/

Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github
Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github
Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github
Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github
Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github
Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github

Hướng dẫn php online payment source code github - mã nguồn thanh toán trực tuyến php github

.

Lưu ý: Nếu bạn đang sử dụng trình bao bọc này với môi trường hộp cát của chúng tôi https://test.instamojo.com/ thì bạn nên chuyển 'https://test.instamojo.com/api/1.1/' làm đối số thứ ba cho lớp Instamojo trong khi khởi tạo nó. Khóa API và mã thông báo auth cho cùng một loại có thể được lấy từ https://test.instamojo.com/developers/ (chi tiết: kiểm tra hoặc tài khoản hộp cát).

$ api = new instamojo \ instamojo (api_key, auth_token, 'https://test.instamojo.com/api/1.1/');

Cài đặt thông qua trình soạn thảo $ PHP Composer.Phar yêu cầu Instamojo/Instamojo-php Lưu ý: Nếu bạn không sử dụng trình soạn thảo thì trực tiếp bao gồm nội dung của thư mục SRC trong dự án của bạn.

Cách sử dụng

$api = new Instamojo\Instamojo(API_KEY, AUTH_TOKEN);
Create a new Payment Request
try {
    $response = $api->paymentRequestCreate(array(
        "purpose" => "FIFA 16",
        "amount" => "3499",
        "send_email" => true,
        "email" => "",
        "redirect_url" => "http://www.example.com/handle_redirect.php"
        ));
    print_r($response);
}
catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

Điều này sẽ cung cấp cho bạn đối tượng JSON chứa chi tiết về yêu cầu thanh toán vừa được tạo.

Nhận trạng thái hoặc chi tiết của yêu cầu thanh toán

try {
    $response = $api->paymentRequestStatus(['PAYMENT REQUEST ID']);
    print_r($response);
}
catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

Điều này sẽ cung cấp cho bạn đối tượng JSON chứa chi tiết về yêu cầu thanh toán và các khoản thanh toán liên quan đến nó. Chìa khóa cho thanh toán là 'thanh toán'.

Ở đây ['ID yêu cầu thanh toán'] là giá trị của khóa 'ID' được trả về bởi truy vấn PayayRequestCreate ().

Nhận trạng thái thanh toán liên quan đến yêu cầu thanh toán

try {
    $response = $api->paymentRequestPaymentStatus(['PAYMENT REQUEST ID'], ['PAYMENT ID']);
    print_r($response['purpose']);  // print purpose of payment request
    print_r($response['payment']['status']);  // print status of payment
}
catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

Điều này sẽ cung cấp cho bạn đối tượng JSON chứa chi tiết về yêu cầu thanh toán và các khoản thanh toán liên quan đến nó. Chìa khóa cho thanh toán là 'thanh toán'.

Ở đây ['ID yêu cầu thanh toán'] là giá trị của khóa 'ID' được trả về bởi truy vấn PayayRequestCreate ().

Nhận trạng thái thanh toán liên quan đến yêu cầu thanh toán

try {
    $response = $api->paymentRequestsList();
    print_r($response);
}
catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

Ở đây ['ID yêu cầu thanh toán'] là giá trị của khóa 'ID' được trả về bởi truy vấn PayayRequestCreate () và ['ID thanh toán'] là ID thanh toán nhận được với URL chuyển hướng hoặc Webhook.

Nhận danh sách các yêu cầu thanh toán

Điều này sẽ cung cấp cho bạn một mảng có chứa các yêu cầu thanh toán được tạo cho đến nay. Lưu ý rằng các khoản thanh toán liên quan đến yêu cầu thanh toán cá nhân không được trả lại với truy vấn này.

PayayRequestSlist () cũng chấp nhận các tham số tùy chọn để phân trang cũng như lọc dựa trên các trường Created_at và UpdateD_AT.

PayayRequestSl

$ phản hồi = $ api-> PayayRequestSlist (50, 1, "2015-11-19t10: 12: 19Z", "2015-10-29T12: 51: 36Z"); Để biết chi tiết liên quan đến định dạng DateTime được hỗ trợ, hãy kiểm tra tài liệu: https://www.instamojo.com/developers/request-a-payment-api/#toc-filtering-payment-Requests

Yêu cầu có sẵn một chức năng thanh toán Bạn có các chức năng này để tương tác với yêu cầu API thanh toán: