Skip to content

Commit

Permalink
Merge pull request #63 from wedevBr/feature/NewRulesBillet
Browse files Browse the repository at this point in the history
[Feature] Added new rules for celcoin billets
  • Loading branch information
adeildo-jr authored Mar 27, 2024
2 parents 3102564 + ff082d4 commit 1476625
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Clients/CelcoinBAASBillet.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CelcoinBAASBillet extends CelcoinBaseApi
{
const BILLET_URL = '/api-integration-baas-webservice/v1/charge';
const BILLET_URL = '/baas/v2/Charge';


/**
Expand Down Expand Up @@ -41,4 +41,9 @@ public function cancelBillet($transactionId)
{
return $this->delete(sprintf('%s/%s', self::BILLET_URL, $transactionId));
}

public function printBillet(string $billetId)
{
return $this->get(sprintf('%s/pdf/%s', self::BILLET_URL, $billetId));
}
}
2 changes: 1 addition & 1 deletion src/Rules/BAAS/Billet.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static function rules(): array
'externalId' => ['required'],
'merchantCategoryCode' => ['sometimes', 'required'],
'expirationAfterPayment' => ['required', 'numeric', 'min:1'],
'duedate' => ['required', 'date'],
'dueDate' => ['required', 'date', 'after:yesterday'],
'amount' => ['required', 'decimal:0,2'],
'key' => ['required'],
'debtor' => ['required', 'array'],
Expand Down
2 changes: 1 addition & 1 deletion src/Types/BAAS/Billet.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Billet extends Data
public string $externalId;
public ?string $merchantCategoryCode;
public int $expirationAfterPayment;
public string $duedate;
public string $dueDate;
public float $amount;
public ?string $key;
/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/BAAS/CelcoinBASSBilletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function billetBodyRequest(): Billet
"externalId" => "externalId1",
"expirationAfterPayment" => 1,
"merchantCatagoryCode" => "0000",
"duedate" => "2023-12-30T00:00:00.0000000",
"dueDate" => now()->format('Y-m-d'),
"amount" => 12.5,
"key" => "[email protected]",
"debtor" => new BilletDebtor([
Expand Down

0 comments on commit 1476625

Please sign in to comment.