Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an actual checkout page #181

Open
2 tasks
creme332 opened this issue May 16, 2024 · 0 comments
Open
2 tasks

Implement an actual checkout page #181

creme332 opened this issue May 16, 2024 · 0 comments
Labels
enhancement New feature or request priority: low
Milestone

Comments

@creme332
Copy link
Member

  • user must be able to enter his credit card details
  • use omnipay for transactions
require 'vendor/autoload.php';

use Omnipay\Omnipay;

// Initialize the Omnipay gateway with the mock driver
$gateway = Omnipay::create('Mock');

// Set parameters for the mock transaction (e.g., amount, currency)
$params = [
    'amount' => '10.00',
    'currency' => 'USD',
    'card' => [
        'number' => '4242424242424242', // A test credit card number
        'expiryMonth' => '12',
        'expiryYear' => '2023',
        'cvv' => '123',
    ],
];

// Send a purchase request to the mock gateway
$response = $gateway->purchase($params)->send();

// Check if the transaction was successful
if ($response->isSuccessful()) {
    // Mock success message
    echo "Transaction successful. Mock payment ID: " . $response->getTransactionReference();
} else {
    // Handle failed transaction
    echo "Transaction failed: " . $response->getMessage();
}
@creme332 creme332 added enhancement New feature or request priority: low labels May 16, 2024
@creme332 creme332 added this to the Semester 2 milestone May 16, 2024
@creme332 creme332 changed the title Implement actual checkout page Implement an actual checkout page Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

1 participant