javascript - Paypal Checkout REST API server side code not clear -
background
i selling on-line live courses user can purchase example 5 live classes. site built codeigniter , checkout page looks this:
my main payment option stripe gateway integrated yesterday minimal hassle. using stripe.js , submitting hidden form pops stripe payment form , redirects processor controller...
paypal on other hand nightmare. confused api should choose...
checkout rest apparently modern , up-to-date option custom integration... paypal documentation says:
the enhanced paypal express checkout in-context gives customers simplified checkout experience keeps them local website throughout payment authorization process , lets them use paypal balance, bank account, or credit card pay without sharing or entering sensitive information on site.
fantastic...
what have tried
i @ enable in-context checkout step , lost due lack of server-side code examples.
i have added example code follows.
<!-- paypal payment --> <form id="mycontainer" method="post" action="<?php echo base_url() . 'paypal/process'; ?>"></form> <script> window.paypalcheckoutready = function () { paypal.checkout.setup('my-merchant-id-here', { environment: 'sandbox', container: 'mycontainer' }); }; </script> <script src="http://www.paypalobjects.com/api/checkout.js" async></script> <!-- end paypal payment -->
problems
when click paypal button whatever echoed in form action url (paypal/process) shows in popup... if put...
class paypal extends mx_controller { public function process() { echo '<h1>test</h1>'; } }
then when click paypal button this....
it should login-to-paypal window, showing controller data!
question(s):
what should putting in controller? further point, information found on paypal's mess of documentation website?
endnote
stripe intuitive, add data popup form echoing order data javascript function... paypal clear mud @ point.
Comments
Post a Comment