Skip to content

Paycoo is a digital wallet that empowers you to make digital payments without the need for an internet connection!

License

Notifications You must be signed in to change notification settings

Paycoo/Payment-gateway-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Paycoo Payment Gateway Integration API

About The Project

Paycoo offer a payment gateway that allows users to pay through their Paycoo wallet or any other linked wallet and enjoying discount percentages or points. Our payment portal is designed to work smoothly.

(back to top)

Process

To receive payment from customer as a merchant a user need to be registered as a merchant by Admin. Once admin registers and approves a merchant account then merchant can login to their panel. Merchant will get public key, secret key and merchant number from merchant panel in developers section.

image

Payment Page Flow:

  • A payment page will be appeared for customer.
  • Customer will put their account number of ( payment gateway ) Paycoo
  • Then proceed to OTP page

image

image

image

image

  • After OTP verification customer will put their valid PIN number.
  • If customer balance is sufficient then customer will be sent to the success page.

Payment process from merchant website/shop:

Make a Payment:

  • First a payment order will be created in payment gateway server:
#Make payment

$url = 'BASE_URL/api/v1/create-payment-order';
$amount = 'YOUR_AMOUNT';

$response = Http::post($url, [
    'public_key'=> 'YOUR_PUBLIC_KEY',
    'secret_key'=> 'YOUR_SECRET_KEY',
    'merchant_number'=> 'MERCHANT_NUMBER',
    'amount'=> $amount,
])->json();


#Response

if($response['status'] == 'merchant_not_found'){
    //Merchant not found
}

if($response['status'] == 'payment_created'){
    return redirect()->away($response['redirect_url']. '&callback=' . $URL_YOU_WANT_TO_REDIRECT_AFTER_PAYMENT_DONE);
}

Callback URL:

Merchant can set a callback url from shop settings, once customer completes the payment process, a transaction summary will be generated and sent to the given callback url.

https://PROJECT_URL/callback

Verification URL:

Using transaction ID merchant website can verify payment for customer:

#Request

$transaction_id = 'GET_TRANSACTION_ID_FROM_REQUEST';
$payment_verification_url = 'https://paycoo.geeksy.tech/api/v1/payment-verification';

$response = Http::post($payment_verification_url, [
    'public_key'=> 'YOUR_PUBLIC_KEY',
    'secret_key'=> 'YOUR_SECRET_KEY',
    'merchant_number'=> 'MERCHANT_NUMBER',
    'transaction_id' => $transaction_id,
])->json();

#Success Response


{
  "payment_record": {
    "id": "6df7e156-69da-47d2-9d61-8464b4be0d42",
    "merchant_user_id": 66,
    "user_id": 57,
    "transaction_id": "Y37tR1674562943",
    "amount": 28,
    "callback": "https://paycoo.geeksy.tech/callback",
    "is_paid": 1,
    "expired_at": "2023-01-24T12:27:12.000000Z",
    "created_at": "2023-01-24T12:22:12.000000Z",
    "updated_at": "2023-01-24T12:22:27.000000Z"
  }
}

#Error Response

{
  "errors": [
    {
      "code": "error code",
      "message": "error message will be here"
    }
  ]
}

About

Paycoo is a digital wallet that empowers you to make digital payments without the need for an internet connection!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published