Skip to content

Commit

Permalink
Merge pull request #3 from chrisidakwo/dev
Browse files Browse the repository at this point in the history
Style format and refactorings
  • Loading branch information
chrisidakwo authored Nov 25, 2020
2 parents d31db92 + 825523d commit 6f89eb0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
use ChrisIdakwo\Flutterwave\Http\Request\HttpPostRequest;

class BankAccountVerificationRequest extends HttpPostRequest {
public const URI = '/accounts/resolve';
public const URI = '/accounts/resolve';
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
use ChrisIdakwo\Flutterwave\Http\Response\HttpResponse;

class BankAccountVerificationResponse extends HttpResponse {

}
2 changes: 1 addition & 1 deletion src/Bank/BankTransfer/BankTransferRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
use ChrisIdakwo\Flutterwave\Http\Request\HttpPostRequest;

class BankTransferRequest extends HttpPostRequest {
public const URI = '/transfers';
public const URI = '/transfers';
}
2 changes: 1 addition & 1 deletion src/Card/ChargeCardToken/ChargeCardTokenRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
use ChrisIdakwo\Flutterwave\Http\Request\HttpPostRequest;

class ChargeCardTokenRequest extends HttpPostRequest {
public const URI = '/tokenized-charges';
public const URI = '/tokenized-charges';
}
14 changes: 7 additions & 7 deletions src/Http/Request/HttpPostRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use ChrisIdakwo\Flutterwave\Http\Request\Contracts\HttpPostRequest as HttpPostRequestContract;

abstract class HttpPostRequest implements HttpPostRequestContract {
public string $url;
protected ?array $data;
public string $url;
protected ?array $data;

public function __construct(string $url, $data = []) {
$this->url = $url;
$this->setBody($data);
}
public function __construct(string $url, $data = []) {
$this->url = $url;
$this->setBody($data);
}

/**
* @inheritDoc
Expand Down Expand Up @@ -40,5 +40,5 @@ public function getBody(): string {
}

return json_encode($this->data, JSON_THROW_ON_ERROR);
}
}
}
5 changes: 3 additions & 2 deletions src/Rave.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ public function verifyBankAccount(string $bankCode, string $accountNumber): arra
}

/**
* Transfer funds from merchant account to a customer's bank account.
*
* @param array $transactionData
* @return Bank\BankTransfer\BankTransfer
* @throws GuzzleException
Expand All @@ -187,7 +189,7 @@ public function bankTransfer(array $transactionData): Bank\BankTransfer\BankTran
}

/**
* Charge a Nigerian bank account.
* Charge a Nigerian bank account. Allow customers to pay using a bank account.
*
* @param array $transactionData
* @return BankAccountCharge
Expand Down Expand Up @@ -320,7 +322,6 @@ public function refundPreAuthCharge(string $flwRef, string $amount): Transaction
$refundResponse = new RefundPreAuthChargeResponse($response);

return $refundResponse->getTransaction();

}

/**
Expand Down
16 changes: 8 additions & 8 deletions src/Support/Validators/StandardPaymentValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public function buildValidator(): v {
->key('payment_options', v::stringVal()->notEmpty())
->key('redirect_url', v::stringVal()->url())
->key('customer', v::arrayVal()->notEmpty())
->keyNested('customer.name', v::stringVal()->notEmpty())
->keyNested('customer.email', v::stringVal()->email())
->keyNested('customer.phonenumber', v::stringVal()->notEmpty())
->key('customizations', v::arrayVal()->notEmpty())
->keyNested('customizations.title', v::stringVal()->notEmpty())
->keyNested('customizations.description', v::stringVal()->notEmpty())
->keyNested('customizations.logo', v::stringVal()->notEmpty());
}
->keyNested('customer.name', v::stringVal()->notEmpty())
->keyNested('customer.email', v::stringVal()->email())
->keyNested('customer.phonenumber', v::stringVal()->notEmpty())
->key('customizations', v::arrayVal()->notEmpty())
->keyNested('customizations.title', v::stringVal()->notEmpty())
->keyNested('customizations.description', v::stringVal()->notEmpty())
->keyNested('customizations.logo', v::stringVal()->notEmpty());
}
}
2 changes: 1 addition & 1 deletion src/Support/Validators/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Respect\Validation\Exceptions\Exception;

abstract class Validator implements IValidator {
public array $data;
public array $data;

private string $errors;

Expand Down

0 comments on commit 6f89eb0

Please sign in to comment.