Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POS] manage NULL error on BTC Invoice #98

Open
jambtc opened this issue Aug 8, 2020 · 0 comments
Open

[POS] manage NULL error on BTC Invoice #98

jambtc opened this issue Aug 8, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jambtc
Copy link
Member

jambtc commented Aug 8, 2020

after invoking invoice, the server response is null

Then the function catch an error: data.error is wrong.

 $.ajax({
            url:'/index.php?r=invoices/Btcpayserver',
            type: "POST",
            beforeSend: function() {
                $('#waiting_span-btc').hide();
                $('#waiting_span-btc').after('<div class="waiting_span"><center><img width=25 src="'+ajax_loader_url+'"></center></div>');
            },
            data:{
                'id_pos'		: '4',
                'amount'		: amount_val,
            },
            dataType: "json",
            success:function(data){
                $('.waiting_span').remove();
                $('#waiting_span-btc').show();
                console.log(data);

                if (data.error){
                    $('.error-header').addClass("bg-danger").show();
                    $('.error-message').text(data.error);
                    return false;
                }else{
                    if ('Btcpayserver' != 'Bitpay')
                        window.location.href = data.url;
                    else
                        top.location = data.url;
                }
            },
@jambtc jambtc added the bug Something isn't working label Aug 8, 2020
@jambtc jambtc self-assigned this Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant