I create a payment link with the following source.
In the sound box the payment can be proceeded.
but in the production It has the error [現時点では、お客さまの要求を処理することができません。もう一度お試しください。].
I use different card but the error is same.
please give me the solution
$recurring_price_money = new \Square\Models\Money();
$recurring_price_money->setAmount($value['price']);
$recurring_price_money->setCurrency('JPY');
$subscription_phase = new \Square\Models\SubscriptionPhase('MONTHLY');
$subscription_phase->setRecurringPriceMoney($recurring_price_money);
$phases = [$subscription_phase];
$subscription_plan_data = new \Square\Models\CatalogSubscriptionPlan($value['name'] . ":" . "¥" . $value['price'] . "/" . "Month");
$subscription_plan_data->setPhases($phases);
$object = new \Square\Models\CatalogObject('SUBSCRIPTION_PLAN', '#'.$value['stripe_price_id']);
$object->setSubscriptionPlanData($subscription_plan_data);
$body = new \Square\Models\UpsertCatalogObjectRequest(uniqid(), $object);
$api_response = $client->getCatalogApi()->upsertCatalogObject($body);
if ($api_response->isSuccess()) {
$result = $api_response->getResult();
$subscription_plan_id = $result->getCatalogObject()->getId();
} else {
$errors = $api_response->getErrors();
var_dump($errors);
}
$price_money = new \Square\Models\Money();
$price_money->setAmount($value['price']);
$price_money->setCurrency('JPY');
$quick_pay_name = $value['name'] . ":" . "¥" . $value['price'] . "/" . "Month";
$quick_pay = new \Square\Models\QuickPay(
$quick_pay_name,
$price_money,
SQUARE_PRODUCTION_LOCATION_ID
);
$checkout_options = new \Square\Models\CheckoutOptions();
$checkout_options->setSubscriptionPlanId($subscription_plan_id);
$body = new \Square\Models\CreatePaymentLinkRequest();
$body->setIdempotencyKey(uniqid().'-CHECKOUT-'.$value['level'].'-'.$_COOKIE[USER_COKKIE_VALUNE_ID]);
$body->setQuickPay($quick_pay);
$body->setCheckoutOptions($checkout_options);
$api_response = $client->getCheckoutApi()->createPaymentLink($body);
if ($api_response->isSuccess()) {
$result = $api_response->getResult();
//header("HTTP/1.1 303 See Other");
header("Location: " . $result->getPaymentLink()->getUrl());
} else {
$errors = $api_response->getErrors();
var_dump($errors);
}
Hi @wengjunxiao , thank you for reaching out!
For the question with the detailed codes, we recommend to post ask in Square Developer Forum or contact to the developer support for the better solution. Thank you!
Hi @wengjunxiao , thank you for reaching out!
For the question with the detailed codes, we recommend to post ask in Square Developer Forum or contact to the developer support for the better solution. Thank you!
Square Community