Start a new topic
Answered

w
  sendTransaction needs 2 arguments not one

started a topic 9 months ago | Viewed: 3683 times | Likes: 0

Reply   



0

 in laravel  i am trying to makke it work but when it comes to

sendTransaction("sale") it gives error that 2 arguments are needed not one

Best Answer

Welcome, Wael,


Thanks for reaching PayTabs out on our Developers Community. My Name is Osama El-Hamahmy from the technical support team and I will be looking into this post and following up with you.


As per the mentioned case, kindly note that the mentioned method "sendTransaction" requires two parameters you should not as null.

paypage::sendTransaction($tran_type,$tran_class)


For more details abour both parameters and how to initiate/manage the payment request and manage the transaction type, please check our soultion articles:
Step 3 - Laravel Package | Initiating the payment

3.2 Laravel Package | Manage the Transaction Type


Note that move his post will move to the right category.

You should also know that we are providing you with a great "Solutions Portal" that includes so many articles that can walk you through any situation such as the "The How to & The What Is (FAQ)" category which contains the technical and non-technical FAQ, and the "How to Integrate with PayTabs?" category which contains all the available methods to integrate with the fully detailed documentation and "Troubleshooting Your Issues/Errors" category which will allow you to trace and solve your issues without seeking for any assistance.


Please don't ever hesitate to comment back if you still have further inquiries.  Let me know if there's anything else I can help with.


Glad to be always in help.

Hoping you have a profitable and successful trade.

Answer

Welcome, Wael,


Thanks for reaching PayTabs out on our Developers Community. My Name is Osama El-Hamahmy from the technical support team and I will be looking into this post and following up with you.


As per the mentioned case, kindly note that the mentioned method "sendTransaction" requires two parameters you should not as null.

paypage::sendTransaction($tran_type,$tran_class)


For more details abour both parameters and how to initiate/manage the payment request and manage the transaction type, please check our soultion articles:
Step 3 - Laravel Package | Initiating the payment

3.2 Laravel Package | Manage the Transaction Type


Note that move his post will move to the right category.

You should also know that we are providing you with a great "Solutions Portal" that includes so many articles that can walk you through any situation such as the "The How to & The What Is (FAQ)" category which contains the technical and non-technical FAQ, and the "How to Integrate with PayTabs?" category which contains all the available methods to integrate with the fully detailed documentation and "Troubleshooting Your Issues/Errors" category which will allow you to trace and solve your issues without seeking for any assistance.


Please don't ever hesitate to comment back if you still have further inquiries.  Let me know if there's anything else I can help with.


Glad to be always in help.

Hoping you have a profitable and successful trade.

thanks for replay it was very helpful but now i got this error about ship name should be string but it is already string


error.png
5.51 KB

my code is

$pay = paypage::sendPaymentCode("all")
        ->sendTransaction("sale","com")
        ->sendCart($cart_id, $cart_amount, $cart_description)
        ->sendCustomerDetails($name, $email, $phone, $street1, $city, $state, $country, $zip, $ip)
        ->sendShippingDetails($same_as_billing, $name =null, $email = null, $phone = null, $street1= null, $city = null, $state = null, $country = null, $zip = null, $ip = null)
        ->sendHideShipping($on = false)
        ->sendURLs($return, $callback)
        ->sendLanguage("en")
        ->sendFramed($on = false)
        ->create_pay_page(); // to initiate payment page
        return view("card", compact("cart_amount"));

Welcome again Wael,


I hope my response finds you well.

Regarding the mentioned error, i can see that there is an issue with the details/variables your sent in the "sendCustomerDetails" function as you have passed the "$same_as _billing" parameter in it, meaning that shipping details is being taken from the customer details values above which is not clear on the sample code you sent, so make sure that you are using valid details in all of customer details values. Additionally, if you are still facing this issue, kindly share with the full sample code containing the customer details and "same_as_billing" values to investigate more properly.

I hope this resolves the confusion.


You should also know that we are providing you with a great "Solutions Portal" that includes so many articles that can walk you through any situation such as the "The How to & The What Is (FAQ)" category which contains the technical and non-technical FAQ, and the "How to Integrate with PayTabs?" category which contains all the available methods to integrate with the fully detailed documentation and "Troubleshooting Your Issues/Errors" category which will allow you to trace and solve your issues without seeking for any assistance.


Please don't ever hesitate to comment back if you still have further inquiries.  Let me know if there's anything else I can help with.


Glad to be always in help.

Hoping you have a profitable and successful trade.