phpviet / laravel-omnipay

:dizzy: Package hổ trợ tích hợp các cổng thanh toán trong nước.
MIT License
91 stars 50 forks source link

Làm thế nào test cho môi trường sanbox với VNPay #5

Closed khanhnam99 closed 4 years ago

khanhnam99 commented 4 years ago

Làm thế nào test cho môi trường sanbox với VNPay $gateway = Omnipay::create('VNPay'); $gateway->initialize([ 'vnp_TmnCode' => '', 'vnp_HashSecret' => '', ]);

    $response = $gateway->purchase([
        'vnp_TxnRef' => time(),
        'vnp_OrderType' => 100000,
        'vnp_OrderInfo' => time(),
        'vnp_IpAddr' => '127.0.0.1',
        'vnp_Amount' => 1000000,
        'vnp_ReturnUrl' => 'https://github.com/phpviet',
    ])->send();

Thấy trong PurchaseRequest có class PurchaseRequest extends AbstractSignatureRequest{

protected $productionEndpoint = 'https://pay.vnpay.vn/vpcpay.html';
protected $testEndpoint = 'http://sandbox.vnpayment.vn/paymentv2/vpcpay.html';
vuongxuongminh commented 4 years ago

$gateway = Omnipay::create('VNPay'); $gateway->initialize([ ..... 'testMode' => true ]);

khanhnam99 commented 4 years ago

thanks