Payeezy “payment method is missing” - php

my Payeezy is throwing an error “payment method is missing”
im testing authorize transaction which i believe doesnt require payment method.
here’s my code
http://pastebin.com/gEyAfyuf
here’s the response on our site at http://wolcottschoolpay.com/test/payeezy_php/test.php
{
correlation_id: "228.1440254919101",
Error:
{
messages:
[
{
code: "payment_method_missing",
description: "The payment method is missing"
},
{
code: "missing_amount",
description: "The amount is missing"
},
{
code: "missing_currency",
description: "The currency is missing"
}
]
},
transaction_status: "Not Processed",
validation_status: "failed",
transaction_type: "authorize",
currency: "USD”
}
I copied most of the part here on the official payeezy php direct library on github.
authorize transaction is on line 127
https://github.com/payeezy/payeezy_direct_API/blob/master/payeezy_php/example/tests/PayeezyTest.php
i also tried both my merchant test details and the one provided at payeezy library but none worked.
Is this a library issue? any idea?

First you need to add x_currency_code and x_amount in api request. without amount and currency it can not process transaction.
And to process payment you need to select payment method like VISA, AMERICAN EXPRESS, DISCOER etc...

As the error message suggests, your request JSON payload is missing amount, currency and payment method. Please add those and try again.

Related

Issue `ZERO_OUTSTANDING_BALANCE` when Capturing authorized payment just after creating subscription in `PAYPAL`

Getting below error when Capturing authorized payment just after creating subscription in PAYPAL. if anyone have idea about why it's happening or got any solution, please reply.
code for capturing the payment of given subscription id. which giving below included error.
$provider = new PayPalClient;
$provider->getAccessToken();
$response = $provider->captureSubscriptionPayment($request->input('subscription_id'), 'capturing payment', (float)$package->price);
Error:-
`{
"name":"UNPROCESSABLE_ENTITY",
"message":"The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id":"2e3384fe1998b",
"details":[
{
"issue":"ZERO_OUTSTANDING_BALANCE",
"description":"Current outstanding balance should be greater than zero."
}
],
"links":[
{
"href":"https://developer.paypal.com/docs/api/v1/billing/subscriptions#UNPROCESSABLE_ENTITY",
"rel":"information_link","method":"GET"
}
]
}`
{
"name":"UNPROCESSABLE_ENTITY",
"message":"The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id":"b1c0f40b4e56b",
"details":[
{
"issue":"AMOUNT_GREATER_THAN_OUTSTANDING_BALANCE",
"description":"The new outstanding balance can not be greater than the current outstanding balance."
}
],
"links":[
{
"href":"https://developer.paypal.com/docs/api/v1/billing/subscriptions#UNPROCESSABLE_ENTITY",
"rel":"information_link","method":"GET"
}
]
}
Another issue is, after creating products, plans & subscription through api, these created products, plans & subscriptions are not visible in dashboard(sandbox paypal account). but when retrieving through api i'm getting all the details. kindly tell why its happening or where to see these.
ps: i'm using https://srmklive.github.io/laravel-paypal/docs.html api for creating products/plans/subscriptions.
PayPal Subscriptions bill automatically, according to the billing_cycles of the plan_id and/or override plan object when the subscription is created. That is the purpose of subscriptions.
When automatic payments have not been missed, there is no outstanding balance to bill. When there is no outstanding balance to bill, payment cannot be captured manually.

MasterCard Sample Code Sample_REST-JSON_PHP error Invalid MerchantID

I am asking for help on an error I got when I try to integrate the MasterCard Payment Gateway Sample Code:
Gateway sample code link: https://ap-gateway.mastercard.com/api/documentation/downloads/example/Sample_REST-JSON_PHP.zip?locale=en_US
I configure the following field in the configuration.php
// Base URL of the Payment Gateway. Do not include the version.
$configArray["gatewayUrl"] = "https://ap-gateway.mastercard.com/api/rest/";
// Merchant ID supplied by your payments provider
$configArray["merchantId"] = "[INSERT-MERCHANT-ID]";
// API username in the format below where Merchant ID is the same as above
$configArray["apiUsername"] = "merchant.[INSERT-MERCHANT-ID]";
// API password which can be configured in Merchant Administration
$configArray["password"] = "";
I am pretty sure my Merchant ID, which is provided by a financial provider, is correct. However, I got the following error, could you please help to advise? Thanks.
{
"error": {
"cause": "INVALID_REQUEST",
"explanation": "Value '[INSERT-MERCHANT-ID]' is invalid. No valid Merchant Acquirer Relationship available",
"field": "merchantId",
"validationType": "INVALID"
},
"result": "ERROR"
}
Regards,
Carlos
You need the merchantId from a payment service provider. It says as much in the error.

Laravel: How can we know the error when sending HTTP request

I am trying to use a Http method to reactivate user's subscription, using HTTP request, but there might be two problems that exist (the json code would return two potential errors):
Reactivating a canceled subscription with an invalid payment profile
Given you have a canceled subscription with ID "1000"
The subscription has an invalid payment profile
Send a PUT request to https://sample.chargify.com/subscriptions/1000/reactivate.json
The response status should be "422 Unprocessable Entity"
The subscription should be canceled with the following response
{
"errors": ["The credit card on file could not be charged."]
}
Attempting to reactivate an already active subscription
Given you have an active subscription with ID "1000"
Send a PUT request to https://sample.chargify.com/subscriptions/1000/reactivate.json
The response status should be "422 Unprocessable Entity"
The subscription should be active with the following JSON response
{
"errors": ["Cannot reactivate a subscription that is not marked
\"Canceled\", \"Unpaid\", or \"Trial Ended\"."]
}
I am new to Laravel, therefore I would like to know the way I can detect the error when sending the request to the server, but right now I only have one option (without a valid if statement) which cannot detect the problem.
I think an if statement would do but I'm not sure how. Thanks!
Okay so the if statement will work if:
if (isset(response()->error)){
// error message
} else {
// success message
}

PayPal API - CURRENCY_NOT_ALLOWED

I am using the PHP PayPal REST API for credit card payments and a sandbox account and I get this error:
PayPal\Core\PayPalHttpConnection :
ERROR: Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment.
{
"name":"CURRENCY_NOT_ALLOWED",
"message":"Currency is not supported",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api/#CURRENCY_NOT_ALLOWED",
"debug_id":"308d4b24ea4b5"
}
The "information_link" they provide does not provide any information whatsoever about CURRENCY_NOT_ALLOWED and what I found on another page of theirs is "more than helpful": Currency is not supported You are using a currency that is not currently supported.
The problematic currency is NOK, while EUR seems to work just fine.
Any idea on how to fix this?
Please check your paypal sendbox account address zone. May be it's not valid for NOK. For more details you can check it here :- https://developer.paypal.com/docs/classic/api/currency_codes/

authorize.net sandbox testing giving error

I am integrating authorize.net in PHP. I have used http://developer.authorize.net/integration/fifteenminutes/#custom this sdk for my development.
For testing, I have created an sandbox account. When I am executing the code - I'm getting below error:-
AuthorizeNet Error: Response Code: 3
Response Subcode: 1
Response Reason Code: 87
Response Reason Text: (TESTMODE) Transactions of this market type cannot be processed on this system.
How will I recover this issue and will make an successful test?
I have also checked payment processing using authorize.net. But not helped me so much.
Any help is appreciated.
EDIT:- code is below
function authorizeNet($options)
{
require_once '../anet_php_sdk/AuthorizeNet.php'; // Make sure this path is correct.
$transaction = new AuthorizeNetAIM('YOUR_API_LOGIN_ID', 'YOUR_TRANSACTION_KEY');
$transaction->amount = $options["gift_amt"];
$transaction->card_num = $options["card_no"];
$transaction->exp_date = $options["card_expiry"];
$response = $transaction->authorizeAndCapture();
if ($response->approved) {
echo "<h1>Success! The test credit card has been charged!</h1>";
echo "Transaction ID: " . $response->transaction_id;
die();
} else {
echo $response->error_message;
die();
}
}
in the place of YOUR_API_LOGIN_ID and YOUR_TRANSACTION_KEY - I placed correct information. Here I don't want to disclose so I haven't mentioned it here.
This error indicates that the account that you are using was created for Card Present (retail) transactions, but you are trying to integrate to our Card Not Present (e-commerce) APIs or vice versa. The only way to resolve this is to open a new sandbox account with the correct market type.

Categories