Subiendo proyecto completo sin restricciones de git ignore

This commit is contained in:
Jose Sanchez
2023-08-17 11:44:02 -04:00
parent a0d4f5ba3b
commit 20f1c60600
19921 changed files with 2509159 additions and 45 deletions

View File

@@ -0,0 +1,40 @@
# Charge via ACH payment
This helps you to accept South African ACH charges from your customers
```php
<?php
$reference = Flutterwave::generateReference();
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'currency' => 'ZAR',
'tx_ref' => $reference,
];
$response = Flutterwave::payments()->ach($data);
if ($response['status'] === 'success') {
# code...
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount | True | This is the amount to be charged. Expected value is ZAR |
| currency | True | ZAR or USD |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |
| redirect_url | False | This is a url you provide, we redirect to it after the customer completes payment and append the response to it as query parameters. |
| country | False | Pass your country as US for US ACH payments and ZA for SA ACH payments. |

View File

@@ -0,0 +1,54 @@
# Charge via Francophone mobile money
This document describes how to collect payments via Francophone mobile money.
```php
<?php
$tx_ref = Flutterwave::generateReference();
$data = [
'amount' => 300,
'currency' => 'XAF',
'phone_number'=> '237******20',
'email' => 'wole@email.co',
'tx_ref' => $tx_ref
];
$charge = Flutterwave::payments()->momoFranc($data);
if ($charge['status'] === 'success') {
$data = Flutterwave::verifyTransaction($charge['data']['id']);
return dd($data);
// Get the transaction from your DB using the transaction reference (txref)
// Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue
// Confirm that the $data['data']['status'] is 'successful'
// Confirm that the currency on your db transaction is equal to the returned currency
// Confirm that the db transaction amount is equal to the returned amount
// Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)
// Give value for the transaction
// Update the transaction to note that you have given value for the transaction
// You can also redirect to your success page from here
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is ZMW |
| currency | True | This is the specified currency to charge in. (expected value: XAF or XOF) ZMW |
| email | True | This is the email address of the customer. |
| phone_number | True | This is the phone number linked to the customer's mobile money account |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| network | True | This is the customer's mobile money network. possible values are `MTN` `ZAMTEL` |
| country | False | Unique ref for the mobilemoney transaction to be provided by the merchant. |
| voucher | False | This is the voucher code generated by the customer. It is meant to be passed in the initial charge request. (only for Vodafone cash) provider |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| redirect_url | False | URL to redirect to when a transaction is completed. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |

View File

@@ -0,0 +1,42 @@
# Charge via Ghana mobile money
This document describes how to collect payments via Ghana mobile money.
```php
<?php
$reference = Flutterwave::generateReference();
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'redirect_url' => route('callback'),
'tx_ref' => $reference,
'phone_number' => '054709929220',
'network' => 'MTN'
];
$charge = Flutterwave::payments()->momoGH($data);
if ($charge['status'] === 'success') {
// Redirect to the charge url
return redirect($charge['data']['redirect']);
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is GHS |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| phone_number | True | This is the phone number linked to the customer's mobile money account. |
| network | True | This is the customer's mobile money network provider (possible values: MTN, VODAFONE, TIGO) |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| redirect_url | False | URL to redirect to when a transaction is completed. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |

View File

@@ -0,0 +1,3 @@
# Introduction
This is needed for merchants that do not want to use Flutterwave Payment Modal, and want to implement the APIs directly

View File

@@ -0,0 +1,49 @@
# Charge via Mpesa
This document describes how to collect payments via Mpesa.
```php
<?php
$tx_ref = Flutterwave::generateReference();
$data = [
'amount' => 1500,
'email' => 'wole@email.co',
'phone_number' => '054709929220',
'tx_ref' => $tx_ref
];
$charge = Flutterwave::payments()->mpesa($data);
if ($charge['status'] === 'success') {
# code...
// Redirect to the charge url
$data = Flutterwave::verifyTransaction($charge['data']['id']);
return dd($data);
// Get the transaction from your DB using the transaction reference (txref)
// Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue
// Confirm that the $data['data']['status'] is 'successful'
// Confirm that the currency on your db transaction is equal to the returned currency
// Confirm that the db transaction amount is equal to the returned amount
// Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)
// Give value for the transaction
// Update the transaction to note that you have given value for the transaction
// You can also redirect to your success page from here
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is ZMW |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | True | This is the phone number linked to the customer's mobile money account. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |

View File

@@ -0,0 +1,38 @@
# Charge via NGN bank transfer (One time Payment)
This allows your customer to pay via a NIP (NIBBS Instant Payment) transfer.
```php
<?php
$reference = Flutterwave::generateReference();
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'tx_ref' => $reference,
'narration' => 'Dstv - Bill Payment'
];
$bankDetails = Flutterwave::payments()->nigeriaBankTransfer($data);
if ($bankDetails['status'] === 'success') {
# show bank details to user
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount | True | This is the amount to be charged. Expected value is NGN |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg ```[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]```|
|meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a']|

View File

@@ -0,0 +1,91 @@
# Payment Modal
## 1. Initiating a Payment
```php
<?php
//This generates a payment reference
$reference = Flutterwave::generateReference();
// Enter the details of the payment
$data = [
'payment_options' => 'card,banktransfer',
'amount' => 500,
'email' => request()->email,
'tx_ref' => $reference,
'currency' => "NGN",
'redirect_url' => route('callback'),
'customer' => [
'email' => request()->email,
"phonenumber" => request()->phone,
"name" => request()->name
],
"customizations" => [
"title" => 'Movie Ticket',
"description" => "20th October"
]
];
$payment = Flutterwave::initializePayment($data);
if (!$payment) {
// notify something went wrong
return;
}
return redirect($payment['link']);
```
### Payment Parameters
| Parameter | Required | Description |
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tx_ref | True | Your transaction reference. This MUST be unique for every transaction |
| amount | True | Amount to charge the customer. |
| currency | False | currency to charge in. Defaults to NGN |
| integrity_hash | False | This is a sha256 hash of your FlutterwaveCheckout values, it is used for passing secured values to the payment gateway. |
| payment_options | True | This specifies the payment options to be displayed e.g - card, mobilemoney, ussd and so on. |
| payment_plan | False | This is the payment plan ID used for Recurring billing |
| redirect_url | True | URL to redirect to when a transaction is completed. This is useful for 3DSecure payments so we can redirect your customer back to a custom page you want to show them. |
| customer | True | This is an object that can contains your customer details: e.g - 'customer': `[ 'email' => 'example@example.com', 'phonenumber' => '08012345678', 'name' => 'Takeshi Kovacs' ]` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
| meta | False | This is an object that helps you include additional payment information to your request e.g `[ 'consumer_id' => 23, 'consumer_mac' => '92a3-912ba-1192a']` |
| customizations | True | This is an object that contains title, logo, and description you want to display on the modal e.g `[ 'title' => 'Pied Piper Payments' 'description' => 'Middleout isn't free. Pay the price', 'logo' => 'https://assets.piedpiper.com/logo.png' ]` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
| meta | False | This is an object that helps you include additional payment information to your request e.g `[ 'consumer_id' => 23, 'consumer_mac' => '92a3-912ba-1192a' ]` |
| customizations | True | This is an object that contains title, logo, and description you want to display on the modal e.g `[ 'title' => 'Pied Piper Payments', 'description' => 'Middleout isn't free. Pay the price', 'logo' => 'https://assets.piedpiper.com/logo.png' ]` |
#### Available payment options
To use custom options for your payment modal, you need to go to your [accounts](https://dashboard.flutterwave.com/dashboard/settings/accounts) page and uncheck `Enable Dashboard Payment Options`
Here are all the possible values for payment options available on Flutterwave:
- account
- card
- banktransfer
- mpesa
- mobilemoneyrwanda
- mobilemoneyzambia
- qr
- mobilemoneyuganda
- ussd
- credit
- barter
- mobilemoneyghana
- payattitude
- mobilemoneyfranco
- paga
- 1voucher
- mobilemoneytanzania
## 2. Verifying a Payment:
```php
<?php
$data = Flutterwave::verifyTransaction(request()->transaction_id);
```

View File

@@ -0,0 +1,44 @@
# Charge via Rwanda mobile money
This document describes how to collect payments via Rwanda mobile money.
```php
<?php
$tx_ref = Flutterwave::generateReference();
$order_id = Flutterwave::generateReference('momo');
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'redirect_url' => route('callback'),
'phone_number' => '054709929220',
'tx_ref' => $tx_ref,
'order_id' => $order_id
];
$charge = Flutterwave::payments()->momoRW($data);
if ($charge['status'] === 'success') {
# code...
// Redirect to the charge url
return redirect($charge['data']['redirect']);
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is RWF |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| order_id | True | Unique ref for the mobilemoney transaction to be provided by the merchant. |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| redirect_url | False | URL to redirect to when a transaction is completed. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |

View File

@@ -0,0 +1,46 @@
# Charge via Uganda mobile money
This document describes how to collect payments via Uganda mobile money.
```php
<?php
$tx_ref = Flutterwave::generateReference();
$order_id = Flutterwave::generateReference('momo');
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'redirect_url' => route('callback'),
'phone_number' => '054709929220',
'tx_ref' => $tx_ref,
'order_id' => $order_id
];
$charge = Flutterwave::payments()->momoUG($data);
if ($charge['status'] === 'success') {
# code...
// Redirect to the charge url
return redirect($charge['data']['redirect']);
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is RWF |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| order_id | False | Unique ref for the mobilemoney transaction to be provided by the merchant. |
| voucher | False | This is the voucher code generated by the customer. It is meant to be passed in the initial charge request. (only for Vodafone cash) provider |
| network | False | This is the customer's mobile money network provider |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| redirect_url | False | URL to redirect to when a transaction is completed. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |

View File

@@ -0,0 +1,51 @@
# Charge via Voucher payment
This page describes how to collect ZAR payments offline using Vouchers
```php
<?php
$reference = Flutterwave::generateReference();
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'tx_ref' => $reference,
'pin' => '19203804939000',
];
$response = Flutterwave::payments()->voucher($data);
if ($response['status'] === 'success') {
# code...
$data = Flutterwave::verifyTransaction($response['data']['id']);
return dd($data);
// Get the transaction from your DB using the transaction reference (txref)
// Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue
// Confirm that the $data['data']['status'] is 'successful'
// Confirm that the currency on your db transaction is equal to the returned currency
// Confirm that the db transaction amount is equal to the returned amount
// Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)
// Give value for the transaction
// Update the transaction to note that you have given value for the transaction
// You can also redirect to your success page from here
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount | True | This is the amount to be charged. Expected value is ZAR |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| pin | True | This is the voucher pin given to the user after redemption at the agent location. They would provide this to you as the voucher code. |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |
| redirect_url | False | This is a url you provide, we redirect to it after the customer completes payment and append the response to it as query parameters. |
| country | False | Pass your country as US for US ACH payments and ZA for SA ACH payments. |

View File

@@ -0,0 +1,47 @@
# Charge via Zambia mobile money
This document describes how to collect payments via Zambia mobile money.
```php
<?php
$tx_ref = Flutterwave::generateReference();
$order_id = Flutterwave::generateReference('momo');
$data = [
'amount' => 100,
'email' => 'wole@email.co',
'redirect_url' => route('callback'),
'phone_number' => '054709929220',
'tx_ref' => $tx_ref,
'network' => 'MTN',
'order_id' => $order_id
];
$charge = Flutterwave::payments()->momoZambia($data);
if ($charge['status'] === 'success') {
# code...
// Redirect to the charge url
return redirect($charge['data']['redirect']);
}
```
## Parameters
| Parameter | Required | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount | True | This is the amount to be charged. Expected value is ZMW |
| email | True | This is the email address of the customer. |
| tx_ref | True | This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction. |
| network | True | This is the customer's mobile money network. possible values are `MTN ` `ZAMTEL` |
| order_id | False | Unique ref for the mobilemoney transaction to be provided by the merchant. |
| voucher | False | This is the voucher code generated by the customer. It is meant to be passed in the initial charge request. (only for Vodafone cash) provider |
| fullname | False | This is the customers full name. It should include first and last name of the customer. |
| phone_number | False | This is the phone number linked to the customer's mobile money account. |
| redirect_url | False | URL to redirect to when a transaction is completed. |
| client_ip | False | IP - Internet Protocol. This represents the current IP address of the customer carrying out the transaction |
| device_fingerprint | False | This is the fingerprint for the device being used. It can be generated using a library on whatever platform is being used. |
| meta | False | This is used to include additional payment information` |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info. eg `[ ["id" => "RS_D87A9EE339AE28BFA2AE86041C6DE70E"]]` |
| meta | False | This is an object that helps you include additional payment information to your request e.g ['consumer_id'=>23, 'consumer_mac'=>'92a3-912ba-1192a'] |