Reputation: 11
I have intrgrated paddle billing api in Laravel , It working fine in sandbox but in live it return errors. enter image description here
This is my code
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
<script>
Paddle.Environment.set("live"}");
Paddle.Initialize({
token: "{{ $data['client_key'] }}",
eventCallback: function(data) {
switch (data.name) {
case "checkout.completed":
let success_url = "{{ $data['return_url'] }}?paddle_order_id=" + data.data
.transaction_id;
window.location.href = success_url;
break;
case "checkout.closed":
window.location.href = "{{ $data['cancel_url'] }}";
break;
}
}
});
let settings = {
displayMode: "overlay",
theme: "light",
locale: "en",
showAddDiscounts: false
};
Paddle.Checkout.open({
settings: settings,
transactionId: "{{ $data['transaction_id'] }}",
});
</script>
How to fix this issue ?
Upvotes: 1
Views: 78
Reputation: 21
Paddle.Environment.Set()
takes parameters "sandbox" or "production". Not "live".
Upvotes: 0