I am really bothered by the fact that PayPal is forcing you to use their design on smart buttons so I wanted to integrate it in another way.
I have a Vue/Laravel app, and on Vue side, this is what it looks like:
<div class="column">
<button class="button is-link is-fullwidth" @click="purchaseWithPayPal">
<span class="icon">
<font-awesome-icon :icon="paypalIcon"/>
</span>
<span>{{ $t('modal.paypal') }}</span>
</button>
</div>
...
purchaseWithPayPal() {
axios.post('api/paypal/make-payment', {
amount: 5
})
},
On Laravel side I was following this post to do the integration.
I did everything the same, but the issue is that upon successful creation of everything I am being redirected:
return redirect()->to($redirect_url);
and it is causing issues because of CORS related errors. I suppose this is due to the fact I am making an AJAX request which is then redirecting, but I don't see a way to make this a simple on-click event. How can I integrate it so that I use my design and circumvent the CORS issue?