Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello there,

    You need to create a new page template, which specifically contains that processing code. Replicate all of the code from MangopayCardregBDD.php into it and make sure it is properly working.

    Then create a new page “Payment” (so its slug will be “payment”) from Dashboard > Pages > Add New) and associate it with the new page template you made.

    For more comprehensive information about creating a page template, see the handbook.

    Regards,
    Kharis

    Thread Starter kniool

    (@kniool)

    Thank you for your response !

    But :

    As you said, i create a new template and associated it with a page.

    2 cases :

    I call the new php file which i had associate to a new test1 page :
    $redirect = ‘https://www.looink.com/wp-content/themes/classiads-child/template-test1.php’;
    It call the php file, it works well but the URL is the same that the $redirect.

    I call directly the new test1 page :
    $redirect = ‘https://www.looink.com/test1’;
    I have the good URL but the page is not good.

    I didn’t said a thing before is that in may template-test1 file, i use this code :
    require ‘MangopayCardreg.php’;
    StartPayment();

    I call a function to create a new user on a payment solution API.
    When i call the php file it works, but when call the page it don’t works.
    I don’t know if i was clear…

    If you know where is the problem…

    Thank you.

    Thread Starter kniool

    (@kniool)

    I try something new :
    I’d try to call my template-test1.php which is composed like that :

    require_once ‘vendor/autoload.php’;

    // create object to manage MangoPay API
    $api = new MangoPay\MangoPayApi();
    // use test client credentails (REPLACE IT BY YOUR CLIENT ONES!)
    $api->Config->ClientId = ‘xxxxxxxxxxxx’;
    $api->Config->ClientPassword = ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’;
    $api->Config->TemporaryFolder = ‘xxxxxxxxxxxxx’;

    $naturalUser = new MangoPay\UserNatural();
    ….
    $naturalUserResult = $api->Users->Create($naturalUser);

    Then when i use the post method with this :
    $redirect = ‘https://www.looink.com/wp-content/themes/classiads-child/template-test1.php’;
    <form method=”post” action=”<?php echo $redirect; ?>”>
    It works fine.

    But when i use the post method with this :
    $redirect = ‘https://www.looink.com/test1’;
    <form method=”post” action=”<?php echo $redirect; ?>”>
    It don’t work : error 500.

    I think the problem is due to the require_once, due to the path.
    Isn’t it?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Post method change url’ is closed to new replies.