Download the PHP package canebaycomputers/valorpay without Composer

On this page you can find all versions of the php package canebaycomputers/valorpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package valorpay

ValorPay for Laravel

canebaycomputers/valorpay is a small Laravel client for ValorPay. It covers the jobs most apps have:

Three rules hold everywhere in this package:

  1. Amounts are in cents. 2500 means $25.00. This matches what ValorPay's transaction list reports.
  2. Card numbers never touch your app. Customers type their card on ValorPay's page. Subscriptions charge the token ValorPay saved from that sale. The package has no way to send a card number.
  3. Webhooks are hints, not proof. In practice ValorPay doesn't sign its webhooks, so anyone can post one to your URL. Check the transaction list before you act on one.

Install

Requires PHP 8.3+ and Laravel 12 or 13 (Guzzle 7 or 8).

Laravel discovers the service provider and the ValorPay facade on its own. Add your credentials to .env:

Put the app ID and key in single quotes, because they can contain $, # and %. To publish the config file (optional):

The credentials are checked when the first call is made, not when the app boots. An app without them still runs; a ValorPay call throws ValorPayException instead.

1. Take a payment

To cancel a page so it can no longer be paid, call ValorPay::cancelHostedPage($uid). It returns true when the page is cancelled, already cancelled or expired. It never throws.

Things to know:

2. Confirm the payment

transactionsForInvoice() returns every record ValorPay has under that invoice number on your EPI: sales, declines, refunds and voids. Transactions gives you the checks:

Method Returns
paidSale($cents) / isPaid($cents) The approved sale for exactly that amount that still stands (not voided, reversed or refunded).
standingSales() Every approved sale that still stands. More than one means a double charge.
reversals() Refunds, voids and reversals, plus sales that were later undone.
all(), first(), isEmpty(), count(), filter(), onEpi() Ordinary list access. Transactions is also iterable.

Each ValorPayRecord provides id(), type(), amountInCents(), approvalCode(), isApproved(), isStandingSale(), isReversal(), invoiceNumber(), payerEmail() (the email typed on ValorPay's page), token(), subscriptionId(), epi(), describe() (for example "SALE 123 ($25.00)"), and get('ANY_FIELD') for any other field.

How the lookup works, so you don't have to:

For other searches there is ValorPay::transactions($filter, $text, $since, $until = null). $filter is one of VT_INVOICE, SUBSCRIPTION_ID, TXNID, RRN, APPROVAL_CODE, AMOUNT, EPI, MID, ADDNL_VAL1, ADDNL_VAL2, or '' for everything. It returns raw substring matches from every device.

3. Bill on a schedule (subscriptions)

ValorPay subscriptions charge a stored card token on a schedule. You get the token from a hosted-page sale, so the customer types their card exactly once, on ValorPay's own page:

Collect the ZIP code yourself. Add Subscription requires a billing ZIP, but hosted-page sales never record one (BILLING_ZIPCODE is always blank), so ask for it on your own form.

SubscriptionRequest checks every field against ValorPay's rules before anything is sent. A bad ZIP, a 13-character invoice number or a 31st-day charge throws InvalidArgumentException before any call goes out. Its arguments:

Argument Default Notes
cents, cardToken, customerName, zip, startsOn required The name is cut to 25 letters. ZIP+4 is accepted.
frequency Monthly
chargeOn day of startsOn Day of the month, 1 to 30 (ValorPay has no 31). Weekly and bi-weekly schedules need a weekday, 0 to 6.
payments null (until cancelled) Total number of charges.
invoiceNumber '' Up to 12 letters and digits. Don't reuse the first sale's invoice number. Recurring charges are matched by subscription ID anyway.
description, email, phone, descriptor descriptor is the text on the card statement, up to 30 characters.
retries ValorPay's default 0 to 10 retries after a charge fails for insufficient funds.
validateCard true Only checks the card when the subscription is created. The first charge happens on startsOn.
notifyOnFailure false Whether ValorPay emails about failed charges.
taxCents 0
extra [] Any other documented field (for example billing_street_name). Card fields are refused.

Managing subscriptions:

To change the card, take a new hosted-page sale and call updateSubscription() with that sale's token.

A Subscription provides id(), isActive(), amountInCents(), chargeDay(), startsFrom(), paymentsMade(), failedAttempts(), maskedCard(), invoiceNumber(), description(), email() and get('field'). ValorPay's list doesn't include the frequency or the next charge date, so store those in your own database.

What a subscription actually charged comes from the transaction list, the same as one-off payments:

ValorPay::cardToken($token) shows what a token points to: masked number, brand and card type.

4. Webhooks: a hint to re-check, never proof

ValorPay posts {event, data} for sales, refunds and recurring billing. In practice ValorPay doesn't sign them (no Valor-Signature header, checked 2026-09-29), and the event names aren't even consistent ("Subcription Deleted" is spelled that way). Use the payload only to decide what to look up:

WebhookHint reads invoice_no, invoicenumber and reference_descriptive_data.invoicenumber for invoices, and both subscription_id and subscriptionid for subscriptions. It accepts data as a single object or as a list, and ignores anything that isn't JSON.

If ValorPay ever does sign its webhooks, Webhooks\WebhookSignature checks the Valor-Signature and Valor-Timestamp headers against VALORPAY_WEBHOOK_SECRET: WebhookSignature::fromConfig()->problem($body, $signature, $timestamp) returns null when the signature is valid, or the reason it isn't. Even with a valid signature, re-check before you act.

Errors

Every call throws CaneBayComputers\ValorPay\ValorPayException when ValorPay can't be reached, refuses a call, or isn't configured. The one exception is cancelHostedPage(), which never throws. $exception->errorNo holds ValorPay's code when it sent one:

Code Meaning
S00 Success. Never thrown.
D07 Bad app key.
D27 Invalid EPI.
E31 No subscription. subscriptions() returns [] and subscription() returns null instead of throwing.
E59 / E60 / E62 Already deactivated / already active / already deleted. Treated as success.
E65 The subscription is already completed, so it can't be activated.
E77 Invalid card token.
A38 / A39 Hosted page already cancelled / already expired. cancelHostedPage() returns true.

Testing your app

The client uses Laravel's HTTP client, so Http::fake() covers it:

What has and hasn't been tried against production

Checked against production with read-only calls (2026-10-09):

Run live by cbc-admin (2026-10-10):

Not yet seen live:

Development

The tests fake every call. Never put real credentials, EPIs or customer data in this repository: it is public.

License

MIT


All versions of valorpay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
nesbot/carbon Version ^3.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package canebaycomputers/valorpay contains the following files

Loading the files please wait ...