Implement COD fee using Shopify Scripts

Highlighted
Shopify Partner
2 0 0

Hi there,

I have to implement a COD transaction fee and I'd like to use scripts.
I added a new shipping method is "Shipping + COD" and I'd like to filter the allowed payment methods to only COD if that payment method is applied. 

Unfortunatelly I didn't find a solution. Can anybody help me?

Cheers,

Raffaele. 

0 Likes
Highlighted
New Member
3 0 0

Yes , i also have the same issue. Can some one pls guide me 

0 Likes
Highlighted
Shopify Partner
2471 129 406

There is an example payments script to get started

https://help.shopify.com/en/manual/apps/apps-by-shopify/script-editor/examples/payment-gateway-scrip...

Keep in mind there's no passing information from a shipping script to a payments script and each has it's own non-global methods.

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Highlighted
New Member
3 0 0

sorry paul what does that mean. can you pls elaborate 

0 Likes
Highlighted
Shopify Partner
2471 129 406

@OFG1 

Some methods can only be used in line item scripts.

https://help.shopify.com/en/manual/apps/apps-by-shopify/script-editor/shopify-scripts

Meaning in a payment script .shipping_rates is not useable , further afaik there's no property clearly indicating which shipping rate was selected.

Cart attributes are also not accessible https://help.shopify.com/en/manual/apps/apps-by-shopify/script-editor/limitations#cart-checkout-attr...

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes