Migrated from Redmine #1231 | Author: Anonymous Status: Feedback | Priority: Immediate, there is BUG! | Created: 2024-05-08
Hello,
I am going to add paymentMethod with custom payment(vipps)
I can see paymentMethod params in approveOrder() functions
public function approveOrder(
int $id, string $reason, string $paymentMethod, ?string $transactionId = null,
?string $paymentMethodReferenceId = null, ?string $paymentMethodName = null
): void;
Please check this.
You can see approve function in here.
I supported sb support team for paymentMethod.
They said me, PaymentMethod will add if I inserted all fields in custom payment.
But paymentMethod is not registered yet.
I checked paymentMethod using getOrder() function.
$client = new \SBPay\SBPayClient(
SBPAY_TOKEN, SBPAY_SECRET,
SBPAY_MERCHANT, SBPAY_HOST
);
print_r($client->payments()->getOrder(1263));
Result is like this.
Please help me how to add paymentMethod in custom payment.
Thank you
Hi, you can store customer’s payment method and in this case you have to pass paymentMethodInfo parameter, which contains
paymentMethodReferenceId - token or reference from your payment system. it will be used to charge subsequent payments.
paymentMethodName - name of payment method (last 4 digits of card, account name, etc.).
Please note that this is required only for recurring and vaulted payments.
$client = new \SBPay\SBPayClient(
SBPAY_TOKEN, SBPAY_SECRET,
SBPAY_MERCHANT, SBPAY_HOST
);
print_r($client->payments()->getOrder(1263));
Result is like this.
order_id is 1263
But PaymentMethod is null in result
As I said before:
you can store customer’s payment method and in this case you have to pass paymentMethodInfo parameter, which contains
paymentMethodReferenceId - token or reference from your payment system. it will be used to charge subsequent payments.
paymentMethodName - name of payment method (last 4 digits of card, account name, etc.).
If you use SDK then you should pass $paymentMethodReferenceId, $paymentMethodName parameters.
Please note that this is required only for recurring and vaulted payments.
There’s no payment method info because you haven’t passed. You have never called approve method for this payment. That is why you are not able to see it.
As I said you, payment status is pending about custom payment.
I received a payment in vipss.
But payment status is pending.
I need to change status from pending to received using sbpay API or SDK.
I thought, payment status will change from pending to received if I use approveOrder function in SDk.
I have to use paymentMethodName and paymentMethodReferenceId params for use this function.
So I asked you about paymentMethodName.
My goal is to change the receiving state using API or SDK.
Please let me know if you have good solution.
Thank you
If i have (approveOrder) I can change payment status if I use this function, i think
But (paymentMethod) is required in here.
We used:
I checked order details using this script. So I asking for paymentMethod
sdk
The problem is that it doesnt not work on the booking page.
The booking status is stuck on pending for a whille then says booking is cancled even though the payment has gone through to Vipps.
so I tried change booking status using sbpay sdk. But paymentMethod param is required in sdk. paymentMethod is null for now
The problem is Its just not showing up as paid sbpays side orderstatus. even though the payment has gone through to vipps you get stuck on booking page for a while then shows booking is cancelld even though payment has gone through.