harrypujianto / Veritrans-Laravel5

33 stars 45 forks source link

Configuration problem #7

Closed robertnicjoo closed 6 years ago

robertnicjoo commented 6 years ago

Hi,

I'm trying to get this application work on laravel 5.5, but I'm not sure how to do it exactly! Your document seems to mostly repeat whats in the files and not exactly helping to run the application. Here are my questions:

  1. How use production mode (which one of your controllers handle that?)

  2. How is structure of production form? because it seems button doesn't work on for example <form action="vtdirect" method="POST" id="payment-form">

  3. How do you store data on Database when user click on payment button (no matter payment is successful or not) it has to be stored in in orders (whatevere the name is) table how that will handle in your application forms?

Thanks.

harrypujianto commented 6 years ago

hi,

  1. public function __construct(){
    Veritrans::$serverKey = 'your-server-key'; --> change into production server key Veritrans::$isProduction = false; ---> change into true. }

  2. did u mean the request json of production ?

  3. the order was store in our database, the response you got wether the payment failed or success, is obtain from our db. if you want to store in your db, please create it your own

robertnicjoo commented 6 years ago

@harrypujianto thanks for respond,

1) my question was which controller and not which part of controller. you have SnapController , TransactionController , VtdirectController , VtwebController

2) No I didn't mean JSON if I use form <form action="vtdirect" method="POST" id="payment-form"> in this form sumbit button will have no action. As you also have several form in checkout.blade , snap_checkout.blade , transaction.blade which form should I use?

3) Yes I need to get info from your database such as request time and transaction code which i don't know how to get them from you, but my main question was that should I place my store code in your controllers (I mentioned in no.1) or I should place it in different controller? (if you have any live sample and can share part of code "storing" would be appreciate it).

Thanks a lot.

harrypujianto commented 6 years ago
  1. there are 3 produts
    • snap is the payment page on iframe, sample code on snapcontroller. see demo.midtrans.com
    • vtweb is payment page with redirection to the gateway page, but now can be covered in snap, since snap now generate redirect link and snap token. open store.midtrans.com to experience vtweb & vt direct. sample code on VtWebController -vtdirect now called coreAPI. custom your own payment page. sample charge code on vtdirectController

as for TransactionController contain the sample code how to use cancel API, get status API, expire API and capture API.

  1. checkout.blade, is sample cc form for vtdirect controller snapcheckout.blade sample code to open snap transaction.blade, an UI page to help the usage of transactionContorller

if u want to test snap, use snapControler, and snapcheckout.blade so does vtdirect and transaction

  1. the controller files provided in this repo just a sample code. you don't really need to use "my" controller, you can create your own if you want to.

for further info about the product API please open these docs

hope that help